Panel Interface Board  1
inszt_UART.c
Go to the documentation of this file.
1 /*
2 C TESTBED VERSION : 9.7.2
3 FILE UNDER TEST : "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\UART.c"
4 DATE OF ANALYSIS : Thu Aug 27 13:27:53 2020
5 */
6 /**************************************************************************************/
25 /**************************************************************************************/
26 /**************************************************************************************/
27 /* Section: Included Files */
28 /**************************************************************************************/
29 /**************************************************************************************/
30 #define QQQdialect MPLABX
31 #undef QQQ146
32 #undef QQQ148
33 #undef QQQbndchk
34 #undef QQQ294
35 #undef QQQEMBEDDEDICE
36  /* Note: for BITMAP execution histories QQQthreaded is not defined */
37 #undef QQQthreaded
38 #undef QQQdo178b
39 #undef QQQfixbra
40 #define QQQswitch3
41 #undef QQQternary
42 #define QQQswitch
43 #undef QQQmacrof
44 #undef QQQMULTIPROCESSEXH
45 #undef QQFLUSH
46 #undef QQNEWBS
47 #define qqqMaxBranchDepth 20
48 #define QQQstructbitmap
49  static int qqqqbmselwidth = 32 ;
50  static int zzfileid = 71;
51 #define QQQnumfil 23
52 #undef QQQALGONE
53 #undef QQQVCLFLG
54 #undef QQQFORKFL
55 #undef QQQIADDRF
56 #undef QQQRTI
57 #undef QQQPERFA
58 #undef QQQADRMOD
59 #undef QQQDCAPFL
60 #undef QQQTEMPLATEONLY
61 #define QQQNOATEXIT
62 #define QQQUPLOADATEND
63 #define QQQNOSTDIO
64 #undef QQQASHLINGVITRA
65 #define QQQBITMAP
66  #define qqqbitmapint unsigned int
67 #undef QQQBITMAPMCDC
68 #undef QQQTIC2XSERIALIO
69 #undef QQQTIC2XFLASH
70 #undef QQQCOMPRESSED_EXH
71 #undef QQQMAINFL
72 #define QQQSINGLEFILE
73 #define QQQFILEID
74 #define QQQseparate
75 extern int QQQindicator;
76 static int QQQfirstmcdc=1;
77 #define UART_71zzopen zzopen
78  extern int UART_71zzopen ;
79 #define UART_71zqqzqz1 zqqzqz1
80 #define QQQLDRA_PORT
81 #ifndef QQQLDRA_PORT
82 #define FILEPOINT FILE * f,
83 #if !defined(QQQTEMPLATEONLY) && !defined(FILE) && !defined(QQQNOSTDIO)
84 #include <stdio.h>
85  /* ----------------------------------------------------------------------* 100 *
86  * If stdio.h is not available then insert:
87  * typedef int * FILE;
88  * -----------------------------------------------------------------------------
89  */
90 #endif /* !(QQQTEMPLATEONLY) && !(FILE) && !(QQQNOSTDIO) */
91 #else /* QQQLDRA_PORT */
92 #define FILEPOINT
93 /*************************** LDRA_PORT *********************************/
94 #ifdef QQQ_SHLAYOUT
95 static int tbrun_mode=1;
96 #else
97 static int tbrun_mode=0;
98 #endif /* QQQ_SHLAYOUT */
99 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.h"
100 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.h"
101 #ifndef QQQ_SHLAYOUT
102 #ifdef QQQMAINFL
103 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.c"
104 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.c"
105 #endif /* QQQMAINFL */
106 #endif /* QQQ_SHLAYOUT */
107 /************************ END OF LDRA_PORT *****************************/
108 #endif /* QQQLDRA_PORT */
109 #ifndef QQQnumfil
110 #define QQQnumfil 40 /* default setting */
111 #endif /* QQQnumfil */
112 #if defined(QQQstructbitmap) && defined(QQQSINGLEFILE)
113 #ifndef LDRA_VOID_FUNC
114 #define LDRA_VOID_FUNC
115  typedef void(*ldra_void_function)();
116 #endif
117 #if defined(QQQMAINFL)
118  /* Set qqqshell_upload to 1 if you want to call the qqqtotalupload separately. Although
119  through the target you would have to set this to 0 before calling the qqqupload.
120  Move this into ldra_port mechanism. */
121  int qqqshell_upload = 0;
122  int QQQfcn_ptr_num = 0;
123  static int qqqisinitialised = 0;
126  void qqqtotalupload(void);
127  void qqqtotalreset(void);
129  qqqaccumupload[x]=y;
130  qqqaccumreset[x]=z;
131  QQQfcn_ptr_num++;
132  }
133 #else /* (QQQMAINFL) */
134  extern int QQQfcn_ptr_num;
137  static int qqqstructzzopen = 0;
138 #endif /* defined(QQQMAINFL) */
139 #endif /* defined(QQQstructbitmap) && defined(QQQSINGLEFILE) */
140 #ifdef QQQ_KEEPCOMMENTS
141  /* -----------------------------------------------------------------------* 101 *
142  * Special settings for systems lacking standard functions.
143  * To include code for fprintf define ldra_fprintf
144  * To include code for sscanf define ldra_sscanf
145  * -----------------------------------------------------------------------------
146  */
147 #endif /* QQQ_KEEPCOMMENTS */
148 #if !defined(QQQSUPPRESS_UNDEF)
149 #undef ldra_fprintf
150 #undef ldra_sscanf
151 #endif /* !defined(QQQSUPPRESS_UNDEF) */
152  /* #define ldra_fprintf */
153  /* #define ldra_sscanf */
154 #undef QQQHITMAP_STORAGE
155 #undef qqnull_params
156 #define qqnull_params void
157 #define QQQ_PROTOTYPE_DEF
158  /* Conventional Instrumentation */
159 #undef QQ_ANSI_PROTOTYPE
160 #ifdef __STDC__
161 #define QQ_ANSI_PROTOTYPE 1
162 #else /* __STDC__ */
163 #ifdef VAXC
164 #define QQ_ANSI_PROTOTYPE 1
165 #endif /* VAXC */
166 #endif /* __STDC__ */
167  static unsigned char qqqzzglobflag = 0;
168  static struct bitmapstruct_t
169  {
170 #define ELEMENT(N) qqqbitmapint element##N;
171 #define LASTELEMENT
172 #include "UART_71zbelem.def"
173 #undef ELEMENT
174 #undef LASTELEMENT
175  } bitmapstruct = {
176 #define ELEMENT(N) 0,
177 #undef LASTELEMENT
178 #include "UART_71zbelem.def"
179 #undef ELEMENT
180  0};
181  static void qqoutput(FILEPOINT char * s,int i);
182  static void qqoutput2(FILEPOINT char * s,int i, int j);
183  static void qqoutput3(FILEPOINT char * s,int i,int j,int k);
184  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l);
185  static void qqoutput0(FILEPOINT char * s);
186  static int UART_71zqqzqz(qqnull_params);
187  static int UART_71zqqzqz1(qqnull_params);
188  static int UART_71zqendz (int qqqi);
189  static int UART_71zqzqzq (int qqqi);
190  static void qqqupload(qqnull_params);
191  static void qqqbitmapreset(qqnull_params);
192 /* ------------------------------ END OF TESTBED PROTOTYPES -------------------------------- */
193 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\UART.h */
194 /**************************************************************************************/
208 /**************************************************************************************/
209 #ifndef UART_H /* Guard against multiple inclusion */
210 #define UART_H
211 /**************************************************************************************/
212 /**************************************************************************************/
213 /* Section: Included Files */
214 /**************************************************************************************/
215 /**************************************************************************************/
216 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h */
217 /*******************************************************************************
218  System Definitions
219  File Name:
220  system_definitions.h
221  Summary:
222  MPLAB Harmony project system definitions.
223  Description:
224  This file contains the system-wide prototypes and definitions for an MPLAB
225  Harmony project.
226  *******************************************************************************/
227 //DOM-IGNORE-BEGIN
228 /*******************************************************************************
229 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
230 Microchip licenses to you the right to use, modify, copy and distribute
231 Software only when embedded on a Microchip microcontroller or digital signal
232 controller that is integrated into your product or third party product
233 (pursuant to the sublicense terms in the accompanying license agreement).
234 You should refer to the license agreement accompanying this Software for
235 additional information regarding your rights and obligations.
236 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
237 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
238 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
239 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
240 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
241 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
242 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
243 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
244 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
245 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
246  *******************************************************************************/
247 //DOM-IGNORE-END
248 #ifndef _SYS_DEFINITIONS_H
249 #define _SYS_DEFINITIONS_H
250 // *****************************************************************************
251 // *****************************************************************************
252 // Section: Included Files
253 // *****************************************************************************
254 // *****************************************************************************
255 #include <stdint.h>
256 #include <stddef.h>
257 #include <stdbool.h>
258 #include "system/common/sys_common.h"
259 #include "system/common/sys_module.h"
260 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h */
261 /*******************************************************************************
262  Input Capture Driver Interface Declarations for Static Single Instance Driver
263  Company:
264  Microchip Technology Inc.
265  File Name:
266  help_drv_ic.h
267  Summary:
268  Input Capture driver interface declarations for the static single instance
269  driver.
270  Description:
271  The Input Capture device driver provides a simple interface to manage the
272  Input Capture modules on Microchip microcontrollers. This file defines
273  the interface declarations for the IC driver.
274 
275  Remarks:
276  Static interfaces incorporate the driver instance number within the names
277  of the routines, eliminating the need for an object ID or object handle.
278 
279  Static single-open interfaces also eliminate the need for the open handle.
280 *******************************************************************************/
281 //DOM-IGNORE-BEGIN
282 /*******************************************************************************
283 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
284 Microchip licenses to you the right to use, modify, copy and distribute
285 Software only when embedded on a Microchip microcontroller or digital signal
286 controller that is integrated into your product or third party product
287 (pursuant to the sublicense terms in the accompanying license agreement).
288 You should refer to the license agreement accompanying this Software for
289 additional information regarding your rights and obligations.
290 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
291 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
292 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
293 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
294 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
295 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
296 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
297 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
298 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
299 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
300 *******************************************************************************/
301 //DOM-IGNORE-END
302 #ifndef _DRV_IC_H
303 #define _DRV_IC_H
304 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h */
305 /*******************************************************************************
306  MPLAB Harmony System Configuration Header
307  File Name:
308  system_config.h
309  Summary:
310  Build-time configuration header for the system defined by this MPLAB Harmony
311  project.
312  Description:
313  An MPLAB Project may have multiple configurations. This file defines the
314  build-time options for a single configuration.
315  Remarks:
316  This configuration header must not define any prototypes or data
317  definitions (or include any files that do). It only provides macro
318  definitions for build-time configuration options that are not instantiated
319  until used by another MPLAB Harmony module or application.
320  Created with MPLAB Harmony Version 2.06
321 *******************************************************************************/
322 // DOM-IGNORE-BEGIN
323 /*******************************************************************************
324 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
325 Microchip licenses to you the right to use, modify, copy and distribute
326 Software only when embedded on a Microchip microcontroller or digital signal
327 controller that is integrated into your product or third party product
328 (pursuant to the sublicense terms in the accompanying license agreement).
329 You should refer to the license agreement accompanying this Software for
330 additional information regarding your rights and obligations.
331 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
332 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
333 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
334 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
335 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
336 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
337 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
338 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
339 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
340 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
341 *******************************************************************************/
342 // DOM-IGNORE-END
343 #ifndef _SYSTEM_CONFIG_H
344 #define _SYSTEM_CONFIG_H
345 // *****************************************************************************
346 // *****************************************************************************
347 // Section: Included Files
348 // *****************************************************************************
349 // *****************************************************************************
350 /* This section Includes other configuration headers necessary to completely
351  define this configuration.
352 */
353 // DOM-IGNORE-BEGIN
354 // DOM-IGNORE-END
355 // *****************************************************************************
356 // *****************************************************************************
357 // Section: System Service Configuration
358 // *****************************************************************************
359 // *****************************************************************************
360 // *****************************************************************************
361 /* Common System Service Configuration Options
362 */
363 #define SYS_VERSION_STR "2.06"
364 #define SYS_VERSION 20600
365 // *****************************************************************************
366 /* Clock System Service Configuration Options
367 */
368 #define SYS_CLK_FREQ 200000000ul
369 #define SYS_CLK_BUS_PERIPHERAL_1 100000000ul
370 #define SYS_CLK_BUS_PERIPHERAL_2 100000000ul
371 #define SYS_CLK_BUS_PERIPHERAL_3 100000000ul
372 #define SYS_CLK_BUS_PERIPHERAL_4 100000000ul
373 #define SYS_CLK_BUS_PERIPHERAL_5 100000000ul
374 #define SYS_CLK_BUS_PERIPHERAL_7 200000000ul
375 #define SYS_CLK_BUS_PERIPHERAL_8 100000000ul
376 #define SYS_CLK_CONFIG_PRIMARY_XTAL 0ul
377 #define SYS_CLK_CONFIG_SECONDARY_XTAL 32768ul
378 /*** Ports System Service Configuration ***/
379 #define SYS_PORT_A_ANSEL 0x3F00
380 #define SYS_PORT_A_TRIS 0xFFED
381 #define SYS_PORT_A_LAT 0x0010
382 #define SYS_PORT_A_ODC 0x0000
383 #define SYS_PORT_A_CNPU 0x0020
384 #define SYS_PORT_A_CNPD 0x0000
385 #define SYS_PORT_A_CNEN 0x0021
386 #define SYS_PORT_B_ANSEL 0x10C8
387 #define SYS_PORT_B_TRIS 0x91FF
388 #define SYS_PORT_B_LAT 0x0000
389 #define SYS_PORT_B_ODC 0x0000
390 #define SYS_PORT_B_CNPU 0x0000
391 #define SYS_PORT_B_CNPD 0x0000
392 #define SYS_PORT_B_CNEN 0x0000
393 #define SYS_PORT_C_ANSEL 0xCFE1
394 #define SYS_PORT_C_TRIS 0xFFFF
395 #define SYS_PORT_C_LAT 0x0000
396 #define SYS_PORT_C_ODC 0x0000
397 #define SYS_PORT_C_CNPU 0x0000
398 #define SYS_PORT_C_CNPD 0x0000
399 #define SYS_PORT_C_CNEN 0x0000
400 #define SYS_PORT_D_ANSEL 0xC100
401 #define SYS_PORT_D_TRIS 0xFFFF
402 #define SYS_PORT_D_LAT 0x0000
403 #define SYS_PORT_D_ODC 0x0000
404 #define SYS_PORT_D_CNPU 0x0000
405 #define SYS_PORT_D_CNPD 0x0000
406 #define SYS_PORT_D_CNEN 0x0000
407 #define SYS_PORT_E_ANSEL 0xFC00
408 #define SYS_PORT_E_TRIS 0xFDFF
409 #define SYS_PORT_E_LAT 0x0000
410 #define SYS_PORT_E_ODC 0x0000
411 #define SYS_PORT_E_CNPU 0x0000
412 #define SYS_PORT_E_CNPD 0x0000
413 #define SYS_PORT_E_CNEN 0x0000
414 #define SYS_PORT_F_ANSEL 0xCEC0
415 #define SYS_PORT_F_TRIS 0xEFFF
416 #define SYS_PORT_F_LAT 0x0000
417 #define SYS_PORT_F_ODC 0x0000
418 #define SYS_PORT_F_CNPU 0x0000
419 #define SYS_PORT_F_CNPD 0x0000
420 #define SYS_PORT_F_CNEN 0x0000
421 #define SYS_PORT_G_ANSEL 0x8CBC
422 #define SYS_PORT_G_TRIS 0xDFFF
423 #define SYS_PORT_G_LAT 0x0000
424 #define SYS_PORT_G_ODC 0x0000
425 #define SYS_PORT_G_CNPU 0x0000
426 #define SYS_PORT_G_CNPD 0x0000
427 #define SYS_PORT_G_CNEN 0x0000
428 #define SYS_PORT_H_ANSEL 0x0070
429 #define SYS_PORT_H_TRIS 0xB3FB
430 #define SYS_PORT_H_LAT 0x0000
431 #define SYS_PORT_H_ODC 0x0000
432 #define SYS_PORT_H_CNPU 0x0000
433 #define SYS_PORT_H_CNPD 0x0000
434 #define SYS_PORT_H_CNEN 0x0000
435 #define SYS_PORT_J_ANSEL 0x0000
436 #define SYS_PORT_J_TRIS 0x8B7F
437 #define SYS_PORT_J_LAT 0x0080
438 #define SYS_PORT_J_ODC 0x0000
439 #define SYS_PORT_J_CNPU 0x0000
440 #define SYS_PORT_J_CNPD 0x0000
441 #define SYS_PORT_J_CNEN 0x0800
442 #define SYS_PORT_K_ANSEL 0xFF00
443 #define SYS_PORT_K_TRIS 0xFFFF
444 #define SYS_PORT_K_LAT 0x0000
445 #define SYS_PORT_K_ODC 0x0000
446 #define SYS_PORT_K_CNPU 0x0000
447 #define SYS_PORT_K_CNPD 0x0000
448 #define SYS_PORT_K_CNEN 0x0000
449 /*** Interrupt System Service Configuration ***/
450 #define SYS_INT true
451 /*** Timer System Service Configuration ***/
452 #define SYS_TMR_POWER_STATE SYS_MODULE_POWER_RUN_FULL
453 #define SYS_TMR_DRIVER_INDEX DRV_TMR_INDEX_0
454 #define SYS_TMR_MAX_CLIENT_OBJECTS 5
455 #define SYS_TMR_FREQUENCY 1000
456 #define SYS_TMR_FREQUENCY_TOLERANCE 10
457 #define SYS_TMR_UNIT_RESOLUTION 10000
458 #define SYS_TMR_CLIENT_TOLERANCE 10
459 #define SYS_TMR_INTERRUPT_NOTIFICATION false
460 // *****************************************************************************
461 // *****************************************************************************
462 // Section: Driver Configuration
463 // *****************************************************************************
464 // *****************************************************************************
465 #define DRV_IC_DRIVER_MODE_STATIC
466 #define USE_8BIT_PMP
467 /*** SPI Driver Configuration ***/
468 #define DRV_SPI_NUMBER_OF_MODULES 6
469 /*** Driver Compilation and static configuration options. ***/
470 /*** Select SPI compilation units.***/
471 #define DRV_SPI_POLLED 1
472 #define DRV_SPI_ISR 0
473 #define DRV_SPI_MASTER 1
474 #define DRV_SPI_SLAVE 0
475 #define DRV_SPI_RM 0
476 #define DRV_SPI_EBM 1
477 #define DRV_SPI_8BIT 1
478 #define DRV_SPI_16BIT 1
479 #define DRV_SPI_32BIT 0
480 #define DRV_SPI_DMA 0
481 /*** SPI Driver Static Allocation Options ***/
482 #define DRV_SPI_INSTANCES_NUMBER 3
483 #define DRV_SPI_CLIENTS_NUMBER 3
484 #define DRV_SPI_ELEMENTS_PER_QUEUE 10
485 /* SPI Driver Instance 0 Configuration */
486 #define DRV_SPI_SPI_ID_IDX0 SPI_ID_1
487 #define DRV_SPI_TASK_MODE_IDX0 DRV_SPI_TASK_MODE_POLLED
488 #define DRV_SPI_SPI_MODE_IDX0 DRV_SPI_MODE_MASTER
489 #define DRV_SPI_ALLOW_IDLE_RUN_IDX0 false
490 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX0 DRV_SPI_PROTOCOL_TYPE_FRAMED
491 #define DRV_SPI_FRAME_SYNC_PULSE_IDX0 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
492 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX0 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
493 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX0 SPI_FRAME_PULSE_DIRECTION_OUTPUT
494 #define DRV_SPI_FRAME_PULSE_EDGE_IDX0 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
495 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX0 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
496 #define DRV_SPI_COMM_WIDTH_IDX0 SPI_COMMUNICATION_WIDTH_16BITS
497 #define DRV_SPI_CLOCK_SOURCE_IDX0 SPI_BAUD_RATE_PBCLK_CLOCK
498 #define DRV_SPI_SPI_CLOCK_IDX0 CLK_BUS_PERIPHERAL_2
499 #define DRV_SPI_BAUD_RATE_IDX0 1000000
500 #define DRV_SPI_BUFFER_TYPE_IDX0 DRV_SPI_BUFFER_TYPE_ENHANCED
501 #define DRV_SPI_CLOCK_MODE_IDX0 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
502 #define DRV_SPI_INPUT_PHASE_IDX0 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
503 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX0 0xFFFF
504 #define DRV_SPI_QUEUE_SIZE_IDX0 10
505 #define DRV_SPI_RESERVED_JOB_IDX0 1
506 /* SPI Driver Instance 1 Configuration */
507 #define DRV_SPI_SPI_ID_IDX1 SPI_ID_2
508 #define DRV_SPI_TASK_MODE_IDX1 DRV_SPI_TASK_MODE_POLLED
509 #define DRV_SPI_SPI_MODE_IDX1 DRV_SPI_MODE_MASTER
510 #define DRV_SPI_ALLOW_IDLE_RUN_IDX1 false
511 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX1 DRV_SPI_PROTOCOL_TYPE_FRAMED
512 #define DRV_SPI_FRAME_SYNC_PULSE_IDX1 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
513 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX1 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
514 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX1 SPI_FRAME_PULSE_DIRECTION_OUTPUT
515 #define DRV_SPI_FRAME_PULSE_EDGE_IDX1 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
516 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX1 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
517 #define DRV_SPI_COMM_WIDTH_IDX1 SPI_COMMUNICATION_WIDTH_8BITS
518 #define DRV_SPI_CLOCK_SOURCE_IDX1 SPI_BAUD_RATE_PBCLK_CLOCK
519 #define DRV_SPI_SPI_CLOCK_IDX1 CLK_BUS_PERIPHERAL_2
520 #define DRV_SPI_BAUD_RATE_IDX1 1000000
521 #define DRV_SPI_BUFFER_TYPE_IDX1 DRV_SPI_BUFFER_TYPE_ENHANCED
522 #define DRV_SPI_CLOCK_MODE_IDX1 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
523 #define DRV_SPI_INPUT_PHASE_IDX1 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
524 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX1 0xFF
525 #define DRV_SPI_QUEUE_SIZE_IDX1 10
526 #define DRV_SPI_RESERVED_JOB_IDX1 1
527 /* SPI Driver Instance 2 Configuration */
528 #define DRV_SPI_SPI_ID_IDX2 SPI_ID_4
529 #define DRV_SPI_TASK_MODE_IDX2 DRV_SPI_TASK_MODE_POLLED
530 #define DRV_SPI_SPI_MODE_IDX2 DRV_SPI_MODE_MASTER
531 #define DRV_SPI_ALLOW_IDLE_RUN_IDX2 false
532 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX2 DRV_SPI_PROTOCOL_TYPE_FRAMED
533 #define DRV_SPI_FRAME_SYNC_PULSE_IDX2 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
534 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX2 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
535 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX2 SPI_FRAME_PULSE_DIRECTION_OUTPUT
536 #define DRV_SPI_FRAME_PULSE_EDGE_IDX2 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
537 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX2 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
538 #define DRV_SPI_COMM_WIDTH_IDX2 SPI_COMMUNICATION_WIDTH_16BITS
539 #define DRV_SPI_CLOCK_SOURCE_IDX2 SPI_BAUD_RATE_PBCLK_CLOCK
540 #define DRV_SPI_SPI_CLOCK_IDX2 CLK_BUS_PERIPHERAL_2
541 #define DRV_SPI_BAUD_RATE_IDX2 500000
542 #define DRV_SPI_BUFFER_TYPE_IDX2 DRV_SPI_BUFFER_TYPE_ENHANCED
543 #define DRV_SPI_CLOCK_MODE_IDX2 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
544 #define DRV_SPI_INPUT_PHASE_IDX2 SPI_INPUT_SAMPLING_PHASE_AT_END
545 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX2 0x0000
546 #define DRV_SPI_QUEUE_SIZE_IDX2 10
547 #define DRV_SPI_RESERVED_JOB_IDX2 1
548 /*** Timer Driver Configuration ***/
549 #define DRV_TMR_INTERRUPT_MODE true
550 /*** Timer Driver 0 Configuration ***/
551 #define DRV_TMR_PERIPHERAL_ID_IDX0 TMR_ID_2
552 #define DRV_TMR_INTERRUPT_SOURCE_IDX0 INT_SOURCE_TIMER_2
553 #define DRV_TMR_INTERRUPT_VECTOR_IDX0 INT_VECTOR_T2
554 #define DRV_TMR_ISR_VECTOR_IDX0 _TIMER_2_VECTOR
555 #define DRV_TMR_INTERRUPT_PRIORITY_IDX0 INT_PRIORITY_LEVEL4
556 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX0 INT_SUBPRIORITY_LEVEL0
557 #define DRV_TMR_CLOCK_SOURCE_IDX0 DRV_TMR_CLKSOURCE_INTERNAL
558 #define DRV_TMR_PRESCALE_IDX0 TMR_PRESCALE_VALUE_8
559 #define DRV_TMR_OPERATION_MODE_IDX0 DRV_TMR_OPERATION_MODE_16_BIT
560 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX0 false
561 #define DRV_TMR_POWER_STATE_IDX0
562 #define DRV_TMR_PERIPHERAL_ID_IDX1 TMR_ID_7
563 #define DRV_TMR_INTERRUPT_SOURCE_IDX1 INT_SOURCE_TIMER_7
564 #define DRV_TMR_INTERRUPT_VECTOR_IDX1 INT_VECTOR_T7
565 #define DRV_TMR_ISR_VECTOR_IDX1 _TIMER_7_VECTOR
566 #define DRV_TMR_INTERRUPT_PRIORITY_IDX1 INT_PRIORITY_LEVEL3
567 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX1 INT_SUBPRIORITY_LEVEL0
568 #define DRV_TMR_CLOCK_SOURCE_IDX1 DRV_TMR_CLKSOURCE_INTERNAL
569 #define DRV_TMR_PRESCALE_IDX1 TMR_PRESCALE_VALUE_16
570 #define DRV_TMR_OPERATION_MODE_IDX1 DRV_TMR_OPERATION_MODE_16_BIT
571 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX1 false
572 #define DRV_TMR_POWER_STATE_IDX1
573 /*** Timer Driver 2 Configuration ***/
574 #define DRV_TMR_PERIPHERAL_ID_IDX2 TMR_ID_6
575 #define DRV_TMR_INTERRUPT_SOURCE_IDX2 INT_SOURCE_TIMER_6
576 #define DRV_TMR_INTERRUPT_VECTOR_IDX2 INT_VECTOR_T6
577 #define DRV_TMR_ISR_VECTOR_IDX2 _TIMER_6_VECTOR
578 #define DRV_TMR_INTERRUPT_PRIORITY_IDX2 INT_PRIORITY_LEVEL1
579 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX2 INT_SUBPRIORITY_LEVEL0
580 #define DRV_TMR_CLOCK_SOURCE_IDX2 DRV_TMR_CLKSOURCE_INTERNAL
581 #define DRV_TMR_PRESCALE_IDX2 TMR_PRESCALE_VALUE_16
582 #define DRV_TMR_OPERATION_MODE_IDX2 DRV_TMR_OPERATION_MODE_16_BIT
583 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX2 false
584 #define DRV_TMR_POWER_STATE_IDX2
585 /*** Timer Driver 3 Configuration ***/
586 #define DRV_TMR_PERIPHERAL_ID_IDX3 TMR_ID_1
587 #define DRV_TMR_INTERRUPT_SOURCE_IDX3 INT_SOURCE_TIMER_1
588 #define DRV_TMR_INTERRUPT_VECTOR_IDX3 INT_VECTOR_T1
589 #define DRV_TMR_ISR_VECTOR_IDX3 _TIMER_1_VECTOR
590 #define DRV_TMR_INTERRUPT_PRIORITY_IDX3 INT_PRIORITY_LEVEL2
591 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX3 INT_SUBPRIORITY_LEVEL0
592 #define DRV_TMR_CLOCK_SOURCE_IDX3 DRV_TMR_CLKSOURCE_INTERNAL
593 #define DRV_TMR_PRESCALE_IDX3 TMR_PRESCALE_VALUE_256
594 #define DRV_TMR_OPERATION_MODE_IDX3 DRV_TMR_OPERATION_MODE_16_BIT
595 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX3 false
596 #define DRV_TMR_POWER_STATE_IDX3
597 /*** Timer Driver 4 Configuration ***/
598 #define DRV_TMR_PERIPHERAL_ID_IDX4 TMR_ID_3
599 #define DRV_TMR_INTERRUPT_SOURCE_IDX4 INT_SOURCE_TIMER_3
600 #define DRV_TMR_INTERRUPT_VECTOR_IDX4 INT_VECTOR_T3
601 #define DRV_TMR_ISR_VECTOR_IDX4 _TIMER_3_VECTOR
602 #define DRV_TMR_INTERRUPT_PRIORITY_IDX4 INT_PRIORITY_LEVEL1
603 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX4 INT_SUBPRIORITY_LEVEL0
604 #define DRV_TMR_CLOCK_SOURCE_IDX4 DRV_TMR_CLKSOURCE_INTERNAL
605 #define DRV_TMR_PRESCALE_IDX4 TMR_PRESCALE_VALUE_16
606 #define DRV_TMR_OPERATION_MODE_IDX4 DRV_TMR_OPERATION_MODE_16_BIT
607 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX4 false
608 #define DRV_TMR_POWER_STATE_IDX4
609  // *****************************************************************************
610 /* USART Driver Configuration Options
611 */
612 #define DRV_USART_INSTANCES_NUMBER 1
613 #define DRV_USART_CLIENTS_NUMBER 1
614 #define DRV_USART_INTERRUPT_MODE false
615 #define DRV_USART_BYTE_MODEL_SUPPORT true
616 #define DRV_USART_READ_WRITE_MODEL_SUPPORT false
617 #define DRV_USART_BUFFER_QUEUE_SUPPORT false
618 // *****************************************************************************
619 // *****************************************************************************
620 // Section: Middleware & Other Library Configuration
621 // *****************************************************************************
622 // *****************************************************************************
623 /*** USB Driver Configuration ***/
624 /* Enables Device Support */
625 #define DRV_USBHS_DEVICE_SUPPORT true
626 /* Disable Host Support */
627 #define DRV_USBHS_HOST_SUPPORT false
628 /* Maximum USB driver instances */
629 #define DRV_USBHS_INSTANCES_NUMBER 1
630 /* Interrupt mode enabled */
631 #define DRV_USBHS_INTERRUPT_MODE true
632 /* Number of Endpoints used */
633 #define DRV_USBHS_ENDPOINTS_NUMBER 2
634 /*** USB Device Stack Configuration ***/
635 /* The USB Device Layer will not initialize the USB Driver */
636 #define USB_DEVICE_DRIVER_INITIALIZE_EXPLICIT
637 /* Maximum device layer instances */
638 #define USB_DEVICE_INSTANCES_NUMBER 1
639 /* EP0 size in bytes */
640 #define USB_DEVICE_EP0_BUFFER_SIZE 64
641 /* Endpoint Transfer Queue Size combined for Read and write */
642 #define USB_DEVICE_ENDPOINT_QUEUE_DEPTH_COMBINED 2
643 // *****************************************************************************
644 // *****************************************************************************
645 // Section: Application Configuration
646 // *****************************************************************************
647 // *****************************************************************************
648 /*** Application Defined Pins ***/
649 /*** Functions for LED1 pin ***/
650 #define LED1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
651 #define LED1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
652 #define LED1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
653 #define LED1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
654 #define LED1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 , Value )
655 /*** Functions for LED2 pin ***/
656 #define LED2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
657 #define LED2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
658 #define LED2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
659 #define LED2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
660 #define LED2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 , Value )
661 /*** Functions for DMP_FIRE_LED pin ***/
662 #define DMP_FIRE_LEDToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
663 #define DMP_FIRE_LEDOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
664 #define DMP_FIRE_LEDOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
665 #define DMP_FIRE_LEDStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
666 #define DMP_FIRE_LEDStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 , Value )
667 /*** Functions for HVPS_ENB pin ***/
668 #define HVPS_ENBToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
669 #define HVPS_ENBOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
670 #define HVPS_ENBOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
671 #define HVPS_ENBStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
672 #define HVPS_ENBStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 , Value )
673 /*** Functions for RLY_HVPS_OUT pin ***/
674 #define RLY_HVPS_OUTToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
675 #define RLY_HVPS_OUTOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
676 #define RLY_HVPS_OUTOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
677 #define RLY_HVPS_OUTStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
678 #define RLY_HVPS_OUTStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 , Value )
679 /*** Functions for RLY_WL_SPS_POL pin ***/
680 #define RLY_WL_SPS_POLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
681 #define RLY_WL_SPS_POLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
682 #define RLY_WL_SPS_POLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
683 #define RLY_WL_SPS_POLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
684 #define RLY_WL_SPS_POLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 , Value )
685 /*** Functions for RLY_LOG pin ***/
686 #define RLY_LOGToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
687 #define RLY_LOGOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
688 #define RLY_LOGOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
689 #define RLY_LOGStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
690 #define RLY_LOGStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 , Value )
691 /*** Functions for RLY_DMP_FIRE pin ***/
692 #define RLY_DMP_FIREToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
693 #define RLY_DMP_FIREOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
694 #define RLY_DMP_FIREOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
695 #define RLY_DMP_FIREStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
696 #define RLY_DMP_FIREStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 , Value )
697 /*** Functions for RLY_AUX pin ***/
698 #define RLY_AUXToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
699 #define RLY_AUXOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
700 #define RLY_AUXOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
701 #define RLY_AUXStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
702 #define RLY_AUXStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 , Value )
703 /*** Functions for RLY_CCL pin ***/
704 #define RLY_CCLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
705 #define RLY_CCLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
706 #define RLY_CCLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
707 #define RLY_CCLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
708 #define RLY_CCLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 , Value )
709 /*** Functions for RLY_WL_MON pin ***/
710 #define RLY_WL_MONToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
711 #define RLY_WL_MONOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
712 #define RLY_WL_MONOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
713 #define RLY_WL_MONStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
714 #define RLY_WL_MONStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 , Value )
715 /*** Functions for RLY_ARMCF pin ***/
716 #define RLY_ARMCFToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
717 #define RLY_ARMCFOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
718 #define RLY_ARMCFOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
719 #define RLY_ARMCFStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
720 #define RLY_ARMCFStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 , Value )
721 /*** Functions for RLY_ARM pin ***/
722 #define RLY_ARMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
723 #define RLY_ARMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
724 #define RLY_ARMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
725 #define RLY_ARMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
726 #define RLY_ARMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 , Value )
727 /*** Functions for TPAN1 pin ***/
728 #define TPAN1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
729 #define TPAN1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
730 #define TPAN1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
731 #define TPAN1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
732 #define TPAN1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 , Value )
733 /*** Functions for TPAN2 pin ***/
734 #define TPAN2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
735 #define TPAN2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
736 #define TPAN2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
737 #define TPAN2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
738 #define TPAN2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 , Value )
739 /*** Functions for FSK_DAC_CS pin ***/
740 #define FSK_DAC_CSToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
741 #define FSK_DAC_CSOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
742 #define FSK_DAC_CSOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
743 #define FSK_DAC_CSStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
744 #define FSK_DAC_CSStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 , Value )
745 /*** Functions for RLY_COMM pin ***/
746 #define RLY_COMMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
747 #define RLY_COMMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
748 #define RLY_COMMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
749 #define RLY_COMMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
750 #define RLY_COMMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 , Value )
751 /*** Functions for FSK_DAC_CLR pin ***/
752 #define FSK_DAC_CLRToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
753 #define FSK_DAC_CLROn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
754 #define FSK_DAC_CLROff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
755 #define FSK_DAC_CLRStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
756 #define FSK_DAC_CLRStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 , Value )
757 /*** Functions for WL_CPS_SW pin ***/
758 #define WL_CPS_SWToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
759 #define WL_CPS_SWOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
760 #define WL_CPS_SWOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
761 #define WL_CPS_SWStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
762 #define WL_CPS_SWStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 , Value )
763 /*** Functions for HVPS_SW pin ***/
764 #define HVPS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_5 )
765 /*** Functions for MAN_SIG pin ***/
766 #define MAN_SIGStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_0 )
767 /*** Functions for DMP_FIRE_SW pin ***/
768 #define DMP_FIRE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_8 )
769 /*** Functions for NEG_SW pin ***/
770 #define NEG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_4 )
771 /*** Functions for POS_SW pin ***/
772 #define POS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_15 )
773 /*** Functions for DRUM1_SW pin ***/
774 #define DRUM1_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_2 )
775 /*** Functions for SAFE_SW pin ***/
776 #define SAFE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_1 )
777 /*** Functions for DRUM2_SW pin ***/
778 #define DRUM2_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_0 )
779 /*** Functions for LOG_SW pin ***/
780 #define LOG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_3 )
781 /*** Functions for AUX_SW pin ***/
782 #define AUX_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_8 )
783 /*** Functions for ARMCF_SW pin ***/
784 #define ARMCF_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_1 )
785 /*** Functions for ARM_SW pin ***/
786 #define ARM_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_2 )
787 /*** Functions for ARMCF_AUTO_SW pin ***/
788 #define ARMCF_AUTO_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_13 )
789 /*** Functions for FIRE_SW_OFF pin ***/
790 #define FIRE_SW_OFFStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_8 )
791 /*** Functions for FIRE_SW_ON pin ***/
792 #define FIRE_SW_ONStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_8 )
793 /*** Functions for WL_SPS_POS_DET pin ***/
794 #define WL_SPS_POS_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_12 )
795 /*** Functions for WL_SPS_NEG_DET pin ***/
796 #define WL_SPS_NEG_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_13 )
797 #define MAN_CN_PORT_CHANNEL PORT_CHANNEL_A
798 #define MAN_CN_PORT_BIT PORTS_BIT_POS_0
799 #define MAN_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_A
800 #define HVPS_CN_PORT_CHANNEL PORT_CHANNEL_J
801 #define HVPS_CN_PORT_BIT PORTS_BIT_POS_11
802 #define HVPS_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_J
803 /*** Application Instance 0 Configuration ***/
804 //DOM-IGNORE-BEGIN
805 //DOM-IGNORE-END
806  // _SYSTEM_CONFIG_H
807 /*******************************************************************************
808  End of File
809 */
810 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h*/
811 /* CLOSE_FILE Include File */
812 
813 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\driver_common.h */
814 /*******************************************************************************
815  Driver Common Header Definitions
816  Company:
817  Microchip Technology Inc.
818  File Name:
819  drv_common.h
820  Summary:
821  This file defines the common macros and definitions used by the driver
822  definition and implementation headers.
823  Description:
824  This file defines the common macros and definitions used by the driver
825  definition and the implementation header.
826  Remarks:
827  The directory in which this file resides should be added to the compiler's
828  search path for header files.
829  *******************************************************************************/
830 //DOM-IGNORE-BEGIN
831 /*******************************************************************************
832 Copyright (c) 2010-2013 released Microchip Technology Inc. All rights reserved.
833 Microchip licenses to you the right to use, modify, copy and distribute
834 Software only when embedded on a Microchip microcontroller or digital signal
835 controller that is integrated into your product or third party product
836 (pursuant to the sublicense terms in the accompanying license agreement).
837 You should refer to the license agreement accompanying this Software for
838 additional information regarding your rights and obligations.
839 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
840 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
841 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
842 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
843 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
844 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
845 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
846 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
847 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
848 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
849  *******************************************************************************/
850 //DOM-IGNORE-END
851 #ifndef _DRV_COMMON_H
852 #define _DRV_COMMON_H
853 #include <stdint.h>
854 #include <stddef.h>
855 // *****************************************************************************
856 /* Device Driver I/O Intent
857  Summary:
858  Identifies the intended usage of the device when it is opened.
859  Description:
860  This enumeration identifies the intended usage of the device when the
861  caller opens the device. It identifies the desired behavior of the device
862  driver for the following:
863  * Blocking or non-blocking I/O behavior (do I/O calls such as read and write
864  block until the operation is finished or do they return immediately and
865  require the caller to call another routine to check the status of the
866  operation)
867  * Support reading and/or writing of data from/to the device
868  * Identify the buffering behavior (sometimes called "double buffering" of
869  the driver. Indicates if the driver should maintain its own read/write
870  buffers and copy data to/from these buffers to/from the caller's buffers.
871  * Identify the DMA behavior of the peripheral
872  Remarks:
873  The buffer allocation method is not identified by this enumeration. Buffers
874  can be allocated statically at build time, dynamically at run-time, or
875  even allocated by the caller and passed to the driver for its own usage if
876  a driver-specific routine is provided for such. This choice is left to
877  the design of the individual driver and is considered part of its
878  interface.
879  These values can be considered "flags". One selection from each of the
880  groups below can be ORed together to create the complete value passed
881  to the driver's open routine.
882 */
883 
884 typedef
885  enum
886  {
887  /* Read */
888  DRV_IO_INTENT_READ /*DOM-IGNORE-BEGIN*/
889  = 1 << 0 /* DOM-IGNORE-END*/
890  ,
891  /* Write */
892  DRV_IO_INTENT_WRITE /*DOM-IGNORE-BEGIN*/
893  = 1 << 1 /* DOM-IGNORE-END*/
894  ,
895  /* Read and Write*/
896  DRV_IO_INTENT_READWRITE /*DOM-IGNORE-BEGIN*/
897  = DRV_IO_INTENT_READ | DRV_IO_INTENT_WRITE /* DOM-IGNORE-END*/
898  ,
899  /* The driver will block and will return when the operation is complete */
900  DRV_IO_INTENT_BLOCKING /*DOM-IGNORE-BEGIN*/
901  = 0 << 2 /* DOM-IGNORE-END*/
902  ,
903  /* The driver will return immediately */
904  DRV_IO_INTENT_NONBLOCKING /*DOM-IGNORE-BEGIN*/
905  = 1 << 2 /* DOM-IGNORE-END*/
906  ,
907  /* The driver will support only one client at a time */
908  DRV_IO_INTENT_EXCLUSIVE /*DOM-IGNORE-BEGIN*/
909  = 1 << 3 /* DOM-IGNORE-END*/
910  ,
911  /* The driver will support multiple clients at a time */
912  DRV_IO_INTENT_SHARED /*DOM-IGNORE-BEGIN*/
913  = 0 << 3 /* DOM-IGNORE-END*/
914  } DRV_IO_INTENT ;
915 // *****************************************************************************
916 /* Driver Client Status
917  Summary:
918  Identifies the current status/state of a client's connection to a driver.
919  Description:
920  This enumeration identifies the current status/state of a client's link to
921  a driver.
922  Remarks:
923  The enumeration used as the return type for the client-level status routines
924  defined by each device driver or system module (for example,
925  DRV_USART_ClientStatus) must be based on the values in this enumeration.
926 */
927 
928 typedef
929  enum
930  {
931  /* Indicates that a driver-specific error has occurred. */
933  /* An unspecified error has occurred.*/
935  /* The driver is closed, no operations for this client are ongoing,
936  and/or the given handle is invalid. */
938  /* The driver is currently busy and cannot start additional operations. */
940  /* The module is running and ready for additional operations */
942  /* Indicates that the module is in a driver-specific ready/run state. */
945 // *****************************************************************************
946 /* Device Driver Blocking Status Macro
947  Summary:
948  Returns if the I/O intent provided is blocking
949  Description:
950  This macro returns if the I/O intent provided is blocking.
951  Remarks:
952  None.
953 */
954 #define DRV_IO_ISBLOCKING( intent ) ( intent & DRV_IO_INTENT_BLOCKING )
955 // *****************************************************************************
956 /* Device Driver Non Blocking Status Macro
957  Summary:
958  Returns if the I/O intent provided is non-blocking.
959  Description:
960  This macro returns if the I/ intent provided is non-blocking.
961  Remarks:
962  None.
963 */
964 #define DRV_IO_ISNONBLOCKING( intent ) ( intent & DRV_IO_INTENT_NONBLOCKING )
965 // *****************************************************************************
966 /* Device Driver Exclusive Status Macro
967  Summary:
968  Returns if the I/O intent provided is non-blocking.
969  Description:
970  This macro returns if the I/O intent provided is non-blocking.
971  Remarks:
972  None.
973 */
974 #define DRV_IO_ISEXCLUSIVE( intent ) ( intent & DRV_IO_INTENT_EXCLUSIVE )
975 // *****************************************************************************
976 /* Device Driver IO Buffer Identifier
977  Summary:
978  Identifies to which buffer a device operation will apply.
979  Description:
980  This enumeration identifies to which buffer (read, write, both, or neither)
981  a device operation will apply. This is used for "flush" (or similar)
982  operations.
983 */
984 
985 typedef
986  enum
987  {
988  // Operation does not apply to any buffer
990  // Operation applies to read buffer
992  // Operation applies to write buffer
994  // Operation applies to both read and write buffers
997 // *****************************************************************************
998 /* Device Handle
999  Summary:
1000  Handle to an opened device driver.
1001  Description:
1002  This handle identifies the open instance of a device driver. It must be
1003  passed to all other driver routines (except the initialization, deinitialization,
1004  or power routines) to identify the caller.
1005  Remarks:
1006  Every application or module that wants to use a driver must first call
1007  the driver's open routine. This is the only routine that is absolutely
1008  required for every driver.
1009  If a driver is unable to allow an additional module to use it, it must then
1010  return the special value DRV_HANDLE_INVALID. Callers should check the
1011  handle returned for this value to ensure this value was not returned before
1012  attempting to call any other driver routines using the handle.
1013 */
1014 
1015 typedef
1016 uintptr_t
1018 // *****************************************************************************
1019 /* Invalid Device Handle
1020  Summary:
1021  Invalid device handle.
1022  Description:
1023  If a driver is unable to allow an additional module to use it, it must then
1024  return the special value DRV_HANDLE_INVALID. Callers should check the
1025  handle returned for this value to ensure this value was not returned before
1026  attempting to call any other driver routines using the handle.
1027  Remarks:
1028  None.
1029 */
1030 #define DRV_HANDLE_INVALID ( ( ( DRV_HANDLE ) - 1 ) )
1031 // *****************************************************************************
1032 /* Not supported configuration
1033  Summary:
1034  Not supported configuration.
1035  Description:
1036  If the configuration option is not supported on an instance of the
1037  peripheral, use this macro to equate to that configuration. This option
1038  should be listed as a possible value in the description of that
1039  configuration option.
1040 */
1041 #define DRV_CONFIG_NOT_SUPPORTED ( ( ( unsigned short ) - 1 ) )
1042 // *****************************************************************************
1043 /* Unsupported Attribute Abstraction
1044  Summary:
1045  Abstracts the use of the unsupported attribute defined by the compiler.
1046  Description:
1047  This macro nulls the definition of the _PLIB_UNSUPPORTED macro, to support
1048  compilation of the drivers for all different variants.
1049  Example:
1050  void _PLIB_UNSUPPORTED PLIB_USART_Enable(USART_MODULE_ID index);
1051  This function will not generate a compiler error if the interface is not
1052  defined for the selected device.
1053  Remarks:
1054  None.
1055 */
1056 #define _PLIB_UNSUPPORTED
1057  //_DRV_COMMON_H
1058 /*******************************************************************************
1059  End of File
1060 */
1061 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\driver_common.h*/
1062 /* CLOSE_FILE Include File */
1063 
1064 #include "system/common/sys_module.h"
1065 // *****************************************************************************
1066 /* IC Driver Module Index Numbers
1067  Summary:
1068  IC driver index definitions.
1069  Description:
1070  These constants provide IC Driver index definitions.
1071  Remarks:
1072  These constants should be used in place of hard-coded numeric literals.
1073  These values should be passed into the DRV_IC_Initialize and
1074  DRV_IC_Open routines to identify the driver instance in use.
1075 */
1076 #define DRV_IC_INDEX_0 0
1077 #define DRV_IC_INDEX_1 1
1078 #define DRV_IC_INDEX_2 2
1079 #define DRV_IC_INDEX_3 3
1080 #define DRV_IC_INDEX_4 4
1081 #define DRV_IC_INDEX_5 5
1082 #define DRV_IC_INDEX_6 6
1083 #define DRV_IC_INDEX_7 7
1084 #define DRV_IC_INDEX_8 8
1085 #define DRV_IC_INDEX_9 9
1086 #define DRV_IC_INDEX_10 10
1087 #define DRV_IC_INDEX_11 11
1088 #define DRV_IC_INDEX_12 12
1089 #define DRV_IC_INDEX_13 13
1090 #define DRV_IC_INDEX_14 14
1091 #define DRV_IC_INDEX_15 15
1092 // *****************************************************************************
1093 // *****************************************************************************
1094 // Section: Interface Headers for the static driver
1095 // *****************************************************************************
1096 // *****************************************************************************
1097 // *****************************************************************************
1098 /* Function:
1099  SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index,
1100  const SYS_MODULE_INIT * const init);
1101  Summary:
1102  Initializes the Input Capture instance for the specified driver index.
1103  <p><b>Implementation:</b> Static</p>
1104  Description:
1105  This routine initializes the Input Capture driver instance for the specified
1106  driver instance, making it ready for clients to use it. The initialization
1107  routine is specified by the MHC parameters. The driver instance index is
1108  independent of the Input Capture module ID. For example, driver instance 0
1109  can be assigned to Input Capture 2.
1110  Precondition:
1111  None.
1112  Parameters:
1113  None.
1114  Returns:
1115  None.
1116  Remarks:
1117  This routine must be called before any other Input Capture routine is called.
1118  This routine should only be called once during system initialization.
1119 */
1120 
1121 SYS_MODULE_OBJ
1123  const SYS_MODULE_INDEX index ,
1124  const SYS_MODULE_INIT * const init ) ;
1125 // *****************************************************************************
1126 /* Function:
1127 DRV_HANDLE DRV_IC_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1128  Summary:
1129  Opens the Input Capture instance for the specified driver index.
1130  <p><b>Implementation:</b> Static</p>
1131  Description:
1132  This routine starts the Input Capture driver for the specified driver
1133  index, starting an input capture.
1134  Precondition:
1135  DRV_IC_Initialize has been called.
1136  Parameters:
1137  None.
1138  Returns:
1139  None.
1140  Remarks:
1141  None.
1142 */
1143 
1144 DRV_HANDLE
1145  DRV_IC_Open (
1146  const SYS_MODULE_INDEX drvIndex ,
1147  const DRV_IO_INTENT intent ) ;
1148 // *****************************************************************************
1149 /* Function:
1150  void DRV_IC_Close(DRV_HANDLE handle)
1151  Summary:
1152  Closes the Input Capture instance for the specified driver index.
1153  <p><b>Implementation:</b> Static</p>
1154  Description:
1155  This routine stops the Input Capture driver for the specified driver
1156  index, stopping an input capture.
1157  Precondition:
1158  DRV_IC_Initialize has been called.
1159  Parameters:
1160  None.
1161  Returns:
1162  None.
1163  Remarks:
1164  None.
1165 */
1166 
1167 void
1168  DRV_IC_Close (
1169  DRV_HANDLE handle ) ;
1170 // *****************************************************************************
1171 /* Function:
1172 DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1173  Summary:
1174  Starts the Input Capture instance for the specified driver index.
1175  <p><b>Implementation:</b> Static</p>
1176  Description:
1177  This routine starts the Input Capture driver for the specified driver
1178  index, starting an input capture.
1179  Precondition:
1180  DRV_IC_Initialize has been called.
1181  Parameters:
1182  None.
1183  Returns:
1184  None.
1185  Remarks:
1186  None.
1187 */
1188 
1189 DRV_HANDLE
1190  DRV_IC_Start (
1191  const SYS_MODULE_INDEX drvIndex ,
1192  const DRV_IO_INTENT intent ) ;
1193 // *****************************************************************************
1194 /* Function:
1195  void DRV_IC_Stop(DRV_HANDLE handle)
1196  Summary:
1197  Stops the Input Capture instance for the specified driver index.
1198  <p><b>Implementation:</b> Static</p>
1199  Description:
1200  This routine stops the Input Capture driver for the specified driver
1201  index, stopping an input capture.
1202  Precondition:
1203  DRV_IC_Initialize has been called.
1204  Parameters:
1205  None.
1206  Returns:
1207  None.
1208  Remarks:
1209  None.
1210 */
1211 
1212 void
1213  DRV_IC_Stop (
1214  DRV_HANDLE handle ) ;
1215 // *****************************************************************************
1216 /* Function:
1217  uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
1218  Summary:
1219  Reads the 32-bit Input Capture for the specified driver index.
1220  <p><b>Implementation:</b> Static</p>
1221  Description:
1222  This routine reads the 32-bit data for the specified driver index
1223  Precondition:
1224  DRV_IC_Initialize has been called.
1225  Parameters:
1226  None.
1227  Returns:
1228  uint32_t value of the data read from the Input Capture.
1229  Remarks:
1230  None.
1231 */
1232 
1233 uint32_t
1235  DRV_HANDLE handle ) ;
1236 // *****************************************************************************
1237 /* Function:
1238  uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
1239  Summary:
1240  Reads the 16-bit Input Capture for the specified driver index.
1241  <p><b>Implementation:</b> Static</p>
1242  Description:
1243  This routine reads the 16-bit data for the specified driver index.
1244  Precondition:
1245  DRV_IC_Initialize has been called.
1246  Parameters:
1247  None.
1248  Returns:
1249  uint16_t value of the data read from the Input Capture.
1250  Remarks:
1251  None.
1252 */
1253 
1254 uint16_t
1256  DRV_HANDLE handle ) ;
1257 // *****************************************************************************
1258 /* Function:
1259  bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
1260  Summary:
1261  Returns the Input Capture instance buffer empty status for the specified driver
1262  index.
1263  <p><b>Implementation:</b> Static</p>
1264  Description:
1265  Returns the Input Capture instance buffer empty status for the specified driver
1266  index. The function should be called to determine whether or not the IC buffer
1267  has data.
1268  Precondition:
1269  DRV_IC_Initialize has been called.
1270  Parameters:
1271  None.
1272  Returns:
1273  Boolean
1274  - 1 - Buffer is empty
1275  - 0 - Buffer is not empty
1276  Remarks:
1277  None.
1278 */
1279 
1280 bool
1282  DRV_HANDLE handle ) ;
1283 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h */
1284 /*******************************************************************************
1285  IC Driver Interface Declarations for Static Single Instance Driver
1286  Company:
1287  Microchip Technology Inc.
1288  File Name:
1289  drv_ic_static.h
1290  Summary:
1291  IC driver interface declarations for the static single instance driver.
1292  Description:
1293  The IC device driver provides a simple interface to manage the IC
1294  modules on Microchip microcontrollers. This file defines the interface
1295  Declarations for the IC driver.
1296 
1297  Remarks:
1298  Static interfaces incorporate the driver instance number within the names
1299  of the routines, eliminating the need for an object ID or object handle.
1300 
1301  Static single-open interfaces also eliminate the need for the open handle.
1302 *******************************************************************************/
1303 //DOM-IGNORE-BEGIN
1304 /*******************************************************************************
1305 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1306 Microchip licenses to you the right to use, modify, copy and distribute
1307 Software only when embedded on a Microchip microcontroller or digital signal
1308 controller that is integrated into your product or third party product
1309 (pursuant to the sublicense terms in the accompanying license agreement).
1310 You should refer to the license agreement accompanying this Software for
1311 additional information regarding your rights and obligations.
1312 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1313 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1314 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1315 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1316 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1317 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1318 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1319 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1320 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1321 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1322 *******************************************************************************/
1323 //DOM-IGNORE-END
1324 #ifndef _DRV_IC_STATIC_H
1325 #define _DRV_IC_STATIC_H
1326 #define DRV_IC_Open( drvIndex , intent ) ( drvIndex )
1327 #define DRV_IC_Close( handle )
1328 // *****************************************************************************
1329 // *****************************************************************************
1330 // Section: Interface Headers for Instance 0 for the static driver
1331 // *****************************************************************************
1332 // *****************************************************************************
1333 
1334 void
1335  DRV_IC0_Initialize ( void ) ;
1336 
1337 void
1338  DRV_IC0_Start ( void ) ;
1339 
1340 void
1341  DRV_IC0_Stop ( void ) ;
1342 
1343 uint32_t
1344  DRV_IC0_Capture32BitDataRead ( void ) ;
1345 
1346 uint16_t
1347  DRV_IC0_Capture16BitDataRead ( void ) ;
1348 
1349 bool
1350  DRV_IC0_BufferIsEmpty ( void ) ;
1351  // #ifndef _DRV_IC_STATIC_H
1352 /*******************************************************************************
1353  End of File
1354 */
1355 
1356 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h*/
1357 /* CLOSE_FILE Include File */
1358 
1359  // #ifndef _DRV_IC_H
1360 /*******************************************************************************
1361  End of File
1362 */
1363 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h*/
1364 /* CLOSE_FILE Include File */
1365 
1366 #include "system/devcon/sys_devcon.h"
1367 #include "system/clk/sys_clk.h"
1368 #include "system/int/sys_int.h"
1369 #include "system/tmr/sys_tmr.h"
1370 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h */
1371 /*******************************************************************************
1372  ADC Driver Interface Declarations for Static Single Instance Driver
1373  Company:
1374  Microchip Technology Inc.
1375  File Name:
1376  drv_adc_static.h
1377  Summary:
1378  ADC driver interface declarations for the static single instance driver.
1379  Description:
1380  The ADC device driver provides a simple interface to manage the ADC
1381  modules on Microchip microcontrollers. This file defines the interface
1382  Declarations for the ADC driver.
1383 
1384  Remarks:
1385  Static interfaces incorporate the driver instance number within the names
1386  of the routines, eliminating the need for an object ID or object handle.
1387 
1388  Static single-open interfaces also eliminate the need for the open handle.
1389 *******************************************************************************/
1390 //DOM-IGNORE-BEGIN
1391 /*******************************************************************************
1392 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1393 Microchip licenses to you the right to use, modify, copy and distribute
1394 Software only when embedded on a Microchip microcontroller or digital signal
1395 controller that is integrated into your product or third party product
1396 (pursuant to the sublicense terms in the accompanying license agreement).
1397 You should refer to the license agreement accompanying this Software for
1398 additional information regarding your rights and obligations.
1399 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1400 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1401 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1402 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1403 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1404 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1405 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1406 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1407 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1408 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1409 *******************************************************************************/
1410 //DOM-IGNORE-END
1411 #ifndef _DRV_ADC_STATIC_H
1412 #define _DRV_ADC_STATIC_H
1413 #include <stdbool.h>
1414 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1415 #include "peripheral/adchs/plib_adchs.h"
1416 #include "peripheral/int/plib_int.h"
1417 
1418 typedef
1419  enum
1420  {
1421  DRV_ADC_ID_1 = ADCHS_ID_0 ,
1423  } DRV_ADC_MODULE_ID ;
1424 // *****************************************************************************
1425 // *****************************************************************************
1426 // Section: Interface Headers for ADC Static Driver
1427 // *****************************************************************************
1428 // *****************************************************************************
1429 
1430 void
1431  DRV_ADC_Initialize ( void ) ;
1432 
1433 inline void
1434  DRV_ADC_DeInitialize ( void ) ;
1435 
1436 inline void
1437  DRV_ADC0_Open ( void ) ;
1438 
1439 inline void
1440  DRV_ADC0_Close ( void ) ;
1441 
1442 inline void
1443  DRV_ADC1_Open ( void ) ;
1444 
1445 inline void
1446  DRV_ADC1_Close ( void ) ;
1447 
1448 inline void
1449  DRV_ADC_Start ( void ) ;
1450 
1451 inline void
1452  DRV_ADC_Stop ( void ) ;
1453 
1454 uint32_t
1456  uint8_t bufIndex ) ;
1457 
1458 bool
1460  uint8_t bufIndex ) ;
1461  // #ifndef _DRV_ADC_STATIC_H
1462 /*******************************************************************************
1463  End of File
1464 */
1465 
1466 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h*/
1467 /* CLOSE_FILE Include File */
1468 
1469 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h */
1470 /*******************************************************************************
1471  Timer Driver Interface Declarations for Static Single Instance Driver
1472  Company:
1473  Microchip Technology Inc.
1474  File Name:
1475  drv_tmr_static.h
1476  Summary:
1477  Timer driver interface declarations for the static single instance driver.
1478  Description:
1479  The Timer device driver provides a simple interface to manage the Timer
1480  modules on Microchip microcontrollers. This file defines the interface
1481  Declarations for the TMR driver.
1482 
1483  Remarks:
1484  Static interfaces incorporate the driver instance number within the names
1485  of the routines, eliminating the need for an object ID or object handle.
1486 
1487  Static single-open interfaces also eliminate the need for the open handle.
1488 *******************************************************************************/
1489 //DOM-IGNORE-BEGIN
1490 /*******************************************************************************
1491 Copyright (c) 2014 released Microchip Technology Inc. All rights reserved.
1492 Microchip licenses to you the right to use, modify, copy and distribute
1493 Software only when embedded on a Microchip microcontroller or digital signal
1494 controller that is integrated into your product or third party product
1495 (pursuant to the sublicense terms in the accompanying license agreement).
1496 You should refer to the license agreement accompanying this Software for
1497 additional information regarding your rights and obligations.
1498 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1499 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1500 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTOCULAR PURPOSE.
1501 IN NO EVENT SHALL MOCROCHIP OR ITS LOCENSORS BE LIABLE OR OBLIGATED UNDER
1502 CONTRACT, NEGLIGENCE, STROCT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1503 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1504 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1505 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1506 SUBSTITUTE GOODS, TECHNOLOGY, SERVOCES, OR ANY CLAIMS BY THIRD PARTIES
1507 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1508 *******************************************************************************/
1509 //DOM-IGNORE-END
1510 #ifndef _DRV_TMR_STATIC_H
1511 #define _DRV_TMR_STATIC_H
1512 // *****************************************************************************
1513 // *****************************************************************************
1514 // Section: Include Headers
1515 // *****************************************************************************
1516 // *****************************************************************************
1517 #include <stdint.h>
1518 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h */
1519 /*******************************************************************************
1520  Timer Device Driver Interface Definition
1521  Company:
1522  Microchip Technology Inc.
1523  File Name:
1524  drv_tmr.h
1525  Summary:
1526  Timer device driver interface header file.
1527  Description:
1528  This header file contains the function prototypes and definitions of the
1529  data types and constants that make up the interface to the Timer device
1530  driver.
1531 *******************************************************************************/
1532 //DOM-IGNORE-BEGIN
1533 /*******************************************************************************
1534 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1535 Microchip licenses to you the right to use, modify, copy and distribute
1536 Software only when embedded on a Microchip microcontroller or digital signal
1537 controller that is integrated into your product or third party product
1538 (pursuant to the sublicense terms in the accompanying license agreement).
1539 You should refer to the license agreement accompanying this Software for
1540 additional information regarding your rights and obligations.
1541 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1542 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1543 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1544 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1545 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1546 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1547 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1548 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1549 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1550 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1551 *******************************************************************************/
1552 //DOM-IGNORE-END
1553 #ifndef _DRV_TMR_H
1554 #define _DRV_TMR_H
1555 // *****************************************************************************
1556 // *****************************************************************************
1557 // Section: File includes
1558 // *****************************************************************************
1559 // *****************************************************************************
1560 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1561 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
1562 #include "peripheral/tmr/plib_tmr.h"
1563 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h */
1564 /*******************************************************************************
1565  Timer Device Driver Interface Definition
1566  Company:
1567  Microchip Technology Inc.
1568  File Name:
1569  tmr_definitions_pic32m.h
1570  Summary:
1571  Timer device driver definitions header file.
1572  Description:
1573  This header file contains the definitions of the
1574  data types and constants that make up the interface to the Timer device
1575  driver.
1576 *******************************************************************************/
1577 //DOM-IGNORE-BEGIN
1578 /*******************************************************************************
1579 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1580 Microchip licenses to you the right to use, modify, copy and distribute
1581 Software only when embedded on a Microchip microcontroller or digital signal
1582 controller that is integrated into your product or third party product
1583 (pursuant to the sublicense terms in the accompanying license agreement).
1584 You should refer to the license agreement accompanying this Software for
1585 additional information regarding your rights and obligations.
1586 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1587 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1588 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1589 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1590 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1591 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1592 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1593 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1594 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1595 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1596 *******************************************************************************/
1597 //DOM-IGNORE-END
1598 #ifndef _TMR_DEFINITIONS_PIC32M_H
1599 #define _TMR_DEFINITIONS_PIC32M_H
1600 // DOM-IGNORE-BEGIN
1601 // DOM-IGNORE-END
1602 
1603 typedef
1604  enum
1605  {
1606  /* Clock input to the timer module is internal(Peripheral Clock) */
1608  /*DOM-IGNORE-BEGIN*/
1609  = 0x00 /*DOM-IGNORE-END*/
1610  ,
1611  /* Clock input to the timer module is from T1CK pin (external)
1612  with clock synchronization enabled */
1614  /*DOM-IGNORE-BEGIN*/
1615  = 0x01 /*DOM-IGNORE-END*/
1616  ,
1617  /* Clock input to the timer module is from T1CK pin (external)
1618  with clock synchronization disabled */
1620  /*DOM-IGNORE-BEGIN*/
1621  = 0x11 /*DOM-IGNORE-END*/
1622  ,
1623  /* Clock input to the timer module is from secondary oscillator (external)
1624  with clock synchronization enabled */
1626  /*DOM-IGNORE-BEGIN*/
1627  = 0x02 /*DOM-IGNORE-END*/
1628  ,
1629  /* Clock input to the timer module is from secondary oscillator (external)
1630  with clock synchronization disabled */
1632  /*DOM-IGNORE-BEGIN*/
1633  = 0x12 /*DOM-IGNORE-END*/
1634  ,
1635  /* Clock input to the timer module is from LPRC
1636  with clock synchronization enabled */
1638  /*DOM-IGNORE-BEGIN*/
1639  = 0x03 /*DOM-IGNORE-END*/
1640  ,
1641  /* Clock input to the timer module is from LPRC
1642  with clock synchronization disabled */
1644  /*DOM-IGNORE-BEGIN*/
1645  = 0x13 /*DOM-IGNORE-END*/
1647 //DOM-IGNORE-BEGIN
1648 //DOM-IGNORE-END
1649  // #ifndef _DRV_TMR_H
1650 /*******************************************************************************
1651  End of File
1652 */
1653 
1654 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h*/
1655 /* CLOSE_FILE Include File */
1656 
1657 #include "system/int/sys_int.h" // System Interrupt Definitions
1658 #include "system/clk/sys_clk.h"
1659 // DOM-IGNORE-BEGIN
1660 // DOM-IGNORE-END
1661 // *****************************************************************************
1662 // *****************************************************************************
1663 // Section: TMR Driver Data Types
1664 // *****************************************************************************
1665 // *****************************************************************************
1666 // *****************************************************************************
1667 /* Timer Driver Module Index Numbers
1668  Summary:
1669  Timer driver index definitions
1670  Description:
1671  These constants provide Timer driver index definitions.
1672  Remarks:
1673  These constants should be used in place of hard-coded numeric literals.
1674  These values should be passed into the DRV_TMR_Initialize and DRV_TMR_Open
1675  functions to identify the driver instance in use.
1676 */
1677 #define DRV_TMR_INDEX_0 0
1678 #define DRV_TMR_INDEX_1 1
1679 #define DRV_TMR_INDEX_2 2
1680 #define DRV_TMR_INDEX_3 3
1681 #define DRV_TMR_INDEX_4 4
1682 #define DRV_TMR_INDEX_5 5
1683 #define DRV_TMR_INDEX_6 6
1684 #define DRV_TMR_INDEX_7 7
1685 #define DRV_TMR_INDEX_8 8
1686 #define DRV_TMR_INDEX_9 9
1687 #define DRV_TMR_INDEX_10 10
1688 #define DRV_TMR_INDEX_11 11
1689 // *****************************************************************************
1690 /* Timer Driver Module Index Count
1691  Summary:
1692  Number of valid Timer driver indices.
1693  Description:
1694  This constant identifies Timer driver index definitions.
1695  Remarks:
1696  This constant should be used in place of hard-coded numeric literals.
1697  This value is device-specific.
1698 */
1699 #define DRV_TMR_INDEX_COUNT TMR_NUMBER_OF_MODULES
1700 // *****************************************************************************
1701 /* Timer Driver Client Status
1702  Summary:
1703  Identifies the client-specific status of the Timer driver
1704  Description:
1705  This enumeration identifies the client-specific status of the Timer driver.
1706  Remarks:
1707  None.
1708 */
1709 
1710 typedef
1711  enum
1712  {
1713  /* Driver is invalid (or unopened) state */
1715  /*DOM-IGNORE-BEGIN*/
1716  = DRV_CLIENT_STATUS_ERROR /*DOM-IGNORE-END*/
1717  ,
1718  /* An operation is currently in progress */
1720  /*DOM-IGNORE-BEGIN*/
1721  = DRV_CLIENT_STATUS_BUSY /*DOM-IGNORE-END*/
1722  ,
1723  /* Ready, no operations running */
1725  /*DOM-IGNORE-BEGIN*/
1726  = DRV_CLIENT_STATUS_READY + 0 /*DOM-IGNORE-END*/
1727  ,
1728  /* Timer started and running, processing transactions */
1730  /*DOM-IGNORE-BEGIN*/
1731  = DRV_CLIENT_STATUS_READY + 1 /*DOM-IGNORE-END*/
1733 // *****************************************************************************
1734 /* Timer Driver Clock sources
1735  Summary:
1736  Lists the clock sources available for timer driver.
1737  Description:
1738  This enumeration lists all the available clock sources for the timer
1739  hardware.
1740  Remarks:
1741  Not all modes are available on all devices.
1742  'Synchronization' may not be applicable for all the instances of the timer.
1743  The driver discards the Synchronization mode selected if it is not
1744  applicable for the selected hardware.
1745 */
1746 // *****************************************************************************
1747 /* Timer Driver Operation mode
1748  Summary:
1749  Lists the operation modes available for timer driver.
1750  Description:
1751  This enumeration lists all the available operation modes that are valid for
1752  the timer hardware.
1753  Remarks:
1754  Not all modes are available on all devices.
1755 */
1756 
1757 typedef
1758  enum
1759  {
1760  /* The timer module operating mode none/invalid */
1762  /* The timer module operates in 16 bit mode */
1764  /* The timer module operates in 32 bit mode */
1765  /* This will combine two 16 bit timer modules */
1768 // *****************************************************************************
1769 /* Timer Driver divider operating specification
1770  Summary:
1771  This data structure specifies the divider values that can be obtained by the
1772  timer module.
1773  Description:
1774  This data structure specifies the divider values that can be obtained by the
1775  timer hardware.
1776  Remarks:
1777  None.
1778 */
1779 
1780 typedef
1781  struct
1782  {
1783  /* The minimum divider value that the timer module can obtain */
1784  uint32_t dividerMin ;
1785  /* The maximum divider value that the timer module can obtain */
1786  uint32_t dividerMax ;
1787  /* The divider step value, between 2 divider values */
1788  /* Should be 1 for most timers */
1789  uint32_t dividerStep ;
1791 // *****************************************************************************
1792 /* Timer Driver Initialize Data
1793  Summary:
1794  Defines the Timer driver initialization data.
1795  Description:
1796  This data type defines data required to initialize the Timer driver.
1797  Remarks:
1798  Not all initialization features are available on all devices.
1799 */
1800 
1801 typedef
1802  struct
1803  {
1804  /* System module initialization. */
1805  SYS_MODULE_INIT moduleInit ;
1806  /* Identifies timer hardware module (PLIB-level) ID */
1807  TMR_MODULE_ID tmrId ;
1808  /* Clock Source select. */
1809  DRV_TMR_CLK_SOURCES clockSource ;
1810  /* Prescaler Selection from the processor enumeration */
1811  TMR_PRESCALE prescale ;
1812  /* Interrupt Source for TMR module. If 'DRV_TMR_OPERATION_MODE_32_BIT' flag
1813  is selected the interrupt will be generated by the 2nd timer of the pair,
1814  the odd numbered one. */
1815  INT_SOURCE interruptSource ;
1816  /* Select 16/32 bit operation mode. 32 bit mode will combine two 16 bit
1817  timer modules to form a 32 bit one. This is usually only necessary for
1818  very long delays. */
1819  DRV_TMR_OPERATION_MODE mode ;
1820  /* Asynchronous write enable configuration. If true the asynchronous write
1821  is enabled. For timers that do not support this feature the value is
1822  ignored */
1823  bool asyncWriteEnable ;
1824  } DRV_TMR_INIT ;
1825 // *****************************************************************************
1826 /* Timer Driver Callback Function Pointer
1827  Summary:
1828  Pointer to a Timer driver callback function data type.
1829  Description:
1830  This data type defines a pointer to a Timer driver callback function.
1831  Remarks:
1832  Useful only when timer alarm callback support is enabled by defining the
1833  DRV_TMR_ALARM_ENABLE configuration option.
1834 */
1835 
1836 typedef
1837 void ( * DRV_TMR_CALLBACK ) ( uintptr_t context ,
1838 uint32_t alarmCount ) ;
1839 // *****************************************************************************
1840 // *****************************************************************************
1841 // Section: Timer Driver Module Interface Functions
1842 // *****************************************************************************
1843 // *****************************************************************************
1844 // *****************************************************************************
1845 /* Function:
1846  SYS_MODULE_OBJ DRV_TMR_Initialize
1847  (
1848  const SYS_MODULE_INDEX drvIndex,
1849  const SYS_MODULE_INIT * const init
1850  )
1851  Summary:
1852  Initializes the Timer driver.
1853  <p><b>Implementation:</b> Static/Dynamic</p>
1854  Description:
1855  This function initializes the Timer driver, making it ready for clients to
1856  open and use it.
1857  Precondition:
1858  None.
1859  Parameters:
1860  drvIndex - Index for the driver instance to be initialized
1861  init - Pointer to a data structure containing any data necessary
1862  to initialize the driver.
1863  Returns:
1864  If successful, returns a valid handle to a driver object. Otherwise, it
1865  returns SYS_MODULE_OBJ_INVALID. The returned object must be passed as
1866  argument to DRV_TMR_Deinitialize, DRV_TMR_Tasks and DRV_TMR_Status functions.
1867  Example:
1868  <code>
1869  DRV_TMR_INIT init;
1870  SYS_MODULE_OBJ objectHandle;
1871  // Populate the timer initialization structure
1872  init.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
1873  init.tmrId = TMR_ID_2;
1874  init.clockSource = DRV_TMR_CLKSOURCE_INTERNAL;
1875  init.prescale = TMR_PRESCALE_VALUE_256;
1876  init.interruptSource = INT_SOURCE_TIMER_2;
1877  init.mode = DRV_TMR_OPERATION_MODE_16_BIT;
1878  init.asyncWriteEnable = false;
1879  // Do something
1880  objectHandle = DRV_TMR_Initialize ( DRV_TMR_INDEX_0, (SYS_MODULE_INIT*)&init );
1881  if ( SYS_MODULE_OBJ_INVALID == objectHandle )
1882  {
1883  // Handle error
1884  }
1885  </code>
1886  Remarks:
1887  This function must be called before any other Timer driver function is
1888  called.
1889  This function should only be called once during system initialization unless
1890  DRV_TMR_Deinitialize is called to deinitialize the driver instance.
1891  This function will NEVER block for hardware access. The system must use
1892  DRV_TMR_Status to find out when the driver is in the ready state.
1893  Build configuration options may be used to statically override options in
1894  the "init" structure and will take precedence over initialization data
1895  passed using this function.
1896 */
1897 
1898 SYS_MODULE_OBJ
1900  const SYS_MODULE_INDEX drvIndex ,
1901  const SYS_MODULE_INIT * const init ) ;
1902 // *****************************************************************************
1903 /* Function:
1904  void DRV_TMR_Deinitialize ( SYS_MODULE_OBJ object )
1905  Summary:
1906  Deinitializes the specified instance of the Timer driver.
1907  <p><b>Implementation:</b> Dynamic</p>
1908  Description:
1909  Deinitializes the specified instance of the Timer driver, disabling
1910  its operation (and any hardware). All internal data is invalidated.
1911  Precondition:
1912  The DRV_TMR_Initialize function must have been called before calling this
1913  function and a valid SYS_MODULE_OBJ must have been returned.
1914  Parameters:
1915  object - Driver object handle, returned from DRV_TMR_Initialize
1916  Returns:
1917  None.
1918  Example:
1919  <code>
1920  SYS_MODULE_OBJ tmrObject; // Returned from DRV_TMR_Initialize
1921  SYS_STATUS tmrStatus;
1922  DRV_TMR_Deinitialize ( tmrObject );
1923  tmrStatus = DRV_TMR_Status ( tmrObject );
1924  if ( SYS_MODULE_UNINITIALIZED == tmrStatus )
1925  {
1926  // Check again later if you need to know
1927  // when the driver is deinitialized.
1928  }
1929  </code>
1930  Remarks:
1931  Once the Initialize operation has been called, the Deinitialize operation
1932  must be called before the Initialize operation can be called again.
1933  This function will NEVER block waiting for hardware. If the operation
1934  requires time to allow the hardware to complete, this will be reported by
1935  the DRV_TMR_Status operation. The system has to use DRV_TMR_Status to find
1936  out when the module is in the ready state.
1937 */
1938 
1939 void
1941  SYS_MODULE_OBJ object ) ;
1942 // *****************************************************************************
1943 /* Function:
1944  SYS_STATUS DRV_TMR_Status ( SYS_MODULE_OBJ object )
1945  Summary:
1946  Provides the current status of the Timer driver.
1947  <p><b>Implementation:</b> Dynamic</p>
1948  Description:
1949  This function provides the current status of the Timer driver.
1950  Precondition:
1951  The DRV_TMR_Initialize function must have been called before calling this
1952  function.
1953  Parameters:
1954  object - Driver object handle, returned from DRV_TMR_Initialize
1955  Returns:
1956  SYS_STATUS_READY - Indicates that the driver is initialized and ready
1957  for operation
1958  Note: Any value greater than SYS_STATUS_READY is
1959  also a normal running state in which the driver
1960  is ready to accept new operations.
1961  SYS_STATUS_ERROR - Indicates that the driver is in an error state
1962  Note: Any value less than SYS_STATUS_ERROR is
1963  also an error state.
1964  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been deinitialized
1965  Note: This value is less than SYS_STATUS_ERROR.
1966  Example:
1967  <code>
1968  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
1969  SYS_STATUS tmrStatus;
1970  tmrStatus = DRV_TMR_Status ( object );
1971  else if ( SYS_STATUS_ERROR >= tmrStatus )
1972  {
1973  // Handle error
1974  }
1975  </code>
1976  Remarks:
1977  The this operation can be used to determine when any of the driver's module
1978  level operations has completed.
1979  Once the status operation returns SYS_STATUS_READY, the driver is ready for
1980  operation.
1981  The value of SYS_STATUS_ERROR is negative (-1). Any value less than that is
1982  also an error state.
1983  This function will NEVER block waiting for hardware.
1984 */
1985 
1986 SYS_STATUS
1987  DRV_TMR_Status (
1988  SYS_MODULE_OBJ object ) ;
1989 // *****************************************************************************
1990 /* Function:
1991  void DRV_TMR_Tasks ( SYS_MODULE_OBJ object )
1992  Summary:
1993  Maintains the driver's state machine.
1994  <p><b>Implementation:</b> Dynamic</p>
1995  Description:
1996  This function is used to maintain the driver's internal state machine and
1997  processes the timer events..
1998  Precondition:
1999  The DRV_TMR_Initialize function must have been called for the specified Timer
2000  driver instance.
2001  Parameters:
2002  object - Object handle for the specified driver instance (returned from
2003  DRV_TMR_Initialize)
2004  Returns:
2005  None
2006  Example:
2007  <code>
2008  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
2009  while (true)
2010  {
2011  DRV_TMR_Tasks ( object );
2012  // Do other tasks
2013  }
2014  </code>
2015  Remarks:
2016  This function is normally not called directly by an application. It is
2017  called by the system's Tasks routine (SYS_Tasks)
2018 */
2019 
2020 void
2021  DRV_TMR_Tasks (
2022  SYS_MODULE_OBJ object ) ;
2023 // *****************************************************************************
2024 // *****************************************************************************
2025 // Section: TMR Driver Client Functions
2026 // *****************************************************************************
2027 // *****************************************************************************
2028 // *****************************************************************************
2029 /* Function:
2030  DRV_HANDLE DRV_TMR_Open
2031  (
2032  const SYS_MODULE_INDEX index,
2033  const DRV_IO_INTENT intent
2034  )
2035  Summary:
2036  Opens the specified Timer driver instance and returns a handle to it.
2037  <p><b>Implementation:</b> Dynamic</p>
2038  Description:
2039  This function opens the specified Timer driver instance and provides a
2040  handle that must be provided to all other client-level operations to
2041  identify the caller and the instance of the driver. Timer driver does not
2042  support multiple clients. If two tasks want to use the timer, one should
2043  wait until the other one gets closed.
2044  Precondition:
2045  The DRV_TMR_Initialize function must have been called before calling this
2046  function.
2047  Parameters:
2048  index - Identifier for the object instance to be opened
2049  intent - Zero or more of the values from the enumeration
2050  DRV_IO_INTENT ORed together to indicate the intended use
2051  of the driver
2052  Returns:
2053  If successful, the function returns a valid open instance handle (a number
2054  identifying both the caller and the module instance).
2055  If an error occurs, the return value is DRV_HANDLE_INVALID.
2056  Example:
2057  <code>
2058  DRV_HANDLE handle;
2059  handle = DRV_TMR_Open ( DRV_TMR_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
2060  if ( DRV_HANDLE_INVALID == handle )
2061  {
2062  // Unable to open the driver
2063  }
2064  </code>
2065  Remarks:
2066  The handle returned is valid until the DRV_TMR_Close function is called.
2067  This function will NEVER block waiting for hardware.
2068  If the requested intent flags are not supported, the function will return
2069  DRV_HANDLE_INVALID.
2070  The Timer driver does not support DRV_IO_INTENT_SHARED.
2071  Only exclusive access is supported for now.
2072 */
2073 
2074 DRV_HANDLE
2075  DRV_TMR_Open (
2076  const SYS_MODULE_INDEX index ,
2077  const DRV_IO_INTENT intent ) ;
2078 // *****************************************************************************
2079 /* Function:
2080  void DRV_TMR_Close ( DRV_HANDLE handle )
2081  Summary:
2082  Closes an opened instance of the Timer driver.
2083  <p><b>Implementation:</b> Dynamic</p>
2084  Description:
2085  This function closes an opened instance of the Timer driver, invalidating
2086  the handle.
2087  Precondition:
2088  The DRV_TMR_Initialize function must have been called for the specified
2089  Timer driver instance.
2090  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2091  Parameters:
2092  handle - A valid open-instance handle, returned from the driver's
2093  open routine
2094  Returns:
2095  None
2096  Example:
2097  <code>
2098  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2099  DRV_TMR_Close ( handle );
2100  </code>
2101  Remarks:
2102  After calling this function, the handle passed in "handle" must not be used
2103  with any of the remaining driver functions. A new handle must be obtained
2104  by calling DRV_TMR_Open before the caller may use the driver again.
2105  Note: Usually there is no need for the driver client to verify that the Close
2106  operation has completed.
2107 */
2108 
2109 void
2110  DRV_TMR_Close (
2111  DRV_HANDLE handle ) ;
2112 // *****************************************************************************
2113 /* Function:
2114  DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus ( DRV_HANDLE handle )
2115  Summary:
2116  Gets the status of the client operation.
2117  <p><b>Implementation:</b> Dynamic</p>
2118  Description:
2119  This function gets the status of the recently completed client level
2120  operation.
2121  Precondition:
2122  The DRV_TMR_Initialize function must have been called for the specified
2123  Timer driver instance.
2124  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2125  Parameters:
2126  handle - A valid open-instance handle, returned from the driver's
2127  open routine
2128  Returns:
2129  None
2130  Example:
2131  <code>
2132  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2133  DRV_TMR_CLIENT_STATUS tmrDrvStatus;
2134  tmrDrvStatus = DRV_TMR_ClientStatus ( tmrHandle );
2135  </code>
2136  Remarks:
2137  None.
2138 */
2139 
2142  DRV_HANDLE handle ) ;
2143 // *****************************************************************************
2144 // *****************************************************************************
2145 // Section: TMR Driver Counting functions
2146 // *****************************************************************************
2147 // *****************************************************************************
2148 // *****************************************************************************
2149 /* Function:
2150  void DRV_TMR_CounterValueSet ( DRV_HANDLE handle, uint32_t counterPeriod )
2151  Summary:
2152  Updates the Timer's counter register.
2153  <p><b>Implementation:</b> Static/Dynamic</p>
2154  Description:
2155  This function updates the Timer's value in the counter register.
2156  Precondition:
2157  The DRV_TMR_Initialize function must have been called.
2158  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2159  Parameters:
2160  handle - A valid open-instance handle, returned from the driver's
2161  open routine
2162  counterPeriod - counter period value
2163  - a 16 bit value if the timer is configured in 16 bit mode
2164  - a 32 bit value if the timer is configured in 32 bit mode
2165  Returns:
2166  None.
2167  Example:
2168  <code>
2169  </code>
2170  Remarks:
2171  None.
2172 */
2173 
2174 void
2176  DRV_HANDLE handle ,
2177  uint32_t counterPeriod ) ;
2178 // *****************************************************************************
2179 /* Function:
2180  uint32_t DRV_TMR_CounterValueGet ( DRV_HANDLE handle )
2181  Summary:
2182  Reads the Timer's counter register.
2183  <p><b>Implementation:</b> Static/Dynamic</p>
2184  Description:
2185  This function returns the Timer's value in the counter register.
2186  Precondition:
2187  The DRV_TMR_Initialize function must have been called.
2188  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2189  Parameters:
2190  handle - A valid open-instance handle, returned from the driver's
2191  open routine
2192  Returns:
2193  Timer current period:
2194  - a 16 bit value if the timer is configured in 16 bit mode
2195  - a 32 bit value if the timer is configured in 32 bit mode
2196  Example:
2197  <code>
2198  //Example to use timer for precision time measurement
2199  //without configuring an alarm (interrupt based)
2200  char appState = 0;
2201  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2202  switch ( appState )
2203  {
2204  case 0:
2205  //Calculate and set the counter period
2206  DRV_TMR_CounterValueSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
2207  //counter starts
2208  DRV_TMR_Start ( tmrHandle );
2209  //Trigger an application operation
2210  app_trigger_operation();
2211  //Check for time-out in the next state
2212  appState++;
2213  case 1:
2214  //Overflows and stops at 0 if no alarm is set
2215  if ( DRV_TMR_CounterValueGet ( tmrHandle ) == 0 )
2216  {
2217  //Time-out
2218  return false;
2219  }
2220  else if ( app_operation_isComplete( ) )
2221  {
2222  //Operation is complete before time-out
2223  return true;
2224  }
2225  </code>
2226  Remarks:
2227  None.
2228 */
2229 
2230 uint32_t
2232  DRV_HANDLE handle ) ;
2233 // *****************************************************************************
2234 /* Function:
2235  void DRV_TMR_CounterClear ( DRV_HANDLE handle )
2236  Summary:
2237  Clears the Timer's counter register.
2238  <p><b>Implementation:</b> Static/Dynamic</p>
2239  Description:
2240  This function clears the Timer's value in the counter register.
2241  Precondition:
2242  The DRV_TMR_Initialize function must have been called.
2243  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2244  Parameters:
2245  handle - A valid open-instance handle, returned from the driver's
2246  open routine
2247  Returns:
2248  None.
2249  Example:
2250  <code>
2251  </code>
2252  Remarks:
2253  None.
2254 */
2255 
2256 void
2258  DRV_HANDLE handle ) ;
2259 // *****************************************************************************
2260 /* Function:
2261  bool DRV_TMR_AlarmRegister
2262  (
2263  DRV_HANDLE handle,
2264  uint32_t divider,
2265  bool isPeriodic,
2266  uintptr_t context,
2267  DRV_TMR_CALLBACK callBack
2268  )
2269  Summary:
2270  Sets up an alarm.
2271  <p><b>Implementation:</b> Dynamic</p>
2272  Description:
2273  This function sets up an alarm, allowing the client to receive a callback
2274  from the driver when the timer counter reaches zero. Alarms can be one-shot
2275  or periodic. A periodic alarm will reload the timer and generate alarm
2276  until stopped. The alarm frequency is: DRV_TMR_CounterFrequencyGet() /
2277  divider;
2278  Precondition:
2279  The DRV_TMR_Initialize function must have been called.
2280  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2281  divider value has to be within the timer divider range (see DRV_TMR_DividerSpecGet).
2282  Parameters:
2283  handle - A valid handle, returned from DRV_TMR_Open
2284  divider - The value to divide the timer clock source to obtain the
2285  required alarm frequency.
2286  - a 16 bit value if the timer is configured in 16 bit mode
2287  - a 32 bit value if the timer is configured in 32 bit mode
2288  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
2289  context - A reference, call back function will be called with the same
2290  reference.
2291  callBack - A call back function which will be called on time out.
2292  Returns:
2293  - true - if the call succeeded
2294  - false - the obtained divider could not be obtained or the passed handle was invalid
2295  Example:
2296  <code>
2297  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
2298  void setupTask ()
2299  {
2300  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2301  uint32_t myFreq = 1000; // 1KHz
2302  uint32_t clkFreq = DRV_TMR_CounterFrequencyGet(tmrHandle); // timer running frequency
2303  // calculate the divider needed
2304  uint32_t divider = clkFreq / myFreq;
2305  // Start the alarm
2306  if(!DRV_TMR_AlarmRegister ( tmrHandle, divider, true, 0, CallBackFreq ))
2307  {
2308  // divider value could not be obtain;
2309  // handle the error
2310  //
2311  }
2312  }
2313  </code>
2314  Remarks:
2315  The divider value will be truncated to a 16 bit value if the timer is
2316  configured in 16 bit mode. The timer should be started using DRV_TMR_Start API to get a
2317  callback.
2318 */
2319 
2320 bool
2322  DRV_HANDLE handle ,
2323  uint32_t divider ,
2324  bool isPeriodic ,
2325  uintptr_t context ,
2326  DRV_TMR_CALLBACK callBack ) ;
2327 // *****************************************************************************
2328 /* Function:
2329  bool DRV_TMR_AlarmDisable ( DRV_HANDLE handle);
2330  Summary:
2331  Disables an alarm signal.
2332  <p><b>Implementation:</b> Dynamic</p>
2333  Description:
2334  This function allows the client to disable an alarm generation.
2335  Use DRV_TMR_AlarmEnable to re-enable.
2336  Precondition:
2337  The DRV_TMR_Initialize function must have been called.
2338  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2339  A client alarm must be active.
2340  Parameters:
2341  handle - A valid handle, returned from DRV_TMR_Open
2342  Returns:
2343  The current status of the alarm:
2344  - true if the alarm was currently enabled
2345  - false if the alarm was currently disabled
2346  Example:
2347  <code>
2348  </code>
2349  Remarks:
2350  When the driver operates in interrupts this call resolves to a device
2351  interrupt disable.
2352  Do NOT disable the timer except for very short periods of time. If the time
2353  that the interrupt is disabled is longer than a wrap around period and the
2354  interrupt is missed, the hardware has no means of recovering and the
2355  resulting timing will be inaccurate.
2356 */
2357 
2358 bool
2360  DRV_HANDLE handle ) ;
2361 // *****************************************************************************
2362 /* Function:
2363  void DRV_TMR_AlarmEnable ( DRV_HANDLE handle, bool enable );
2364  Summary:
2365  Re-enables an alarm signal.
2366  <p><b>Implementation:</b> Dynamic</p>
2367  Description:
2368  This function allows the client to re-enable an alarm after it has been
2369  disabled by a DRV_TMR_AlarmDisable call.
2370  Precondition:
2371  The DRV_TMR_Initialize function must have been called.
2372  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2373  Parameters:
2374  handle - A valid handle, returned from DRV_TMR_Open
2375  enable - boolean to enable the current callback
2376  Returns:
2377  None
2378  Example:
2379  <code>
2380  </code>
2381  Remarks:
2382  When the driver operates in interrupts this call resolves to a device
2383  interrupt re-enable.
2384 */
2385 
2386 void
2388  DRV_HANDLE handle ,
2389  bool enable ) ;
2390 // *****************************************************************************
2391 /* Function:
2392  void DRV_TMR_AlarmPeriodSet ( DRV_HANDLE handle, uint32_t value )
2393  Summary:
2394  Updates the Timer's period.
2395  <p><b>Implementation:</b> Dynamic</p>
2396  Description:
2397  This function updates the Timer's period.
2398  Precondition:
2399  The DRV_TMR_Initialize function must have been called.
2400  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2401  Parameters:
2402  handle - A valid open-instance handle, returned from the driver's
2403  open routine
2404  value - Period value
2405  - a 16 bit value if the timer is configured in 16 bit mode
2406  - a 32 bit value if the timer is configured in 32 bit mode
2407  Returns:
2408  None.
2409  Example:
2410  <code>
2411  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2412  DRV_TMR_AlarmPeriodSet ( handle, 0x1000 );
2413  </code>
2414  Remarks:
2415  - The period value will be truncated to a 16 bit value if the timer is
2416  configured in 16 bit mode.
2417 */
2418 
2419 void
2421  DRV_HANDLE handle ,
2422  uint32_t value ) ;
2423 // *****************************************************************************
2424 /* Function:
2425  uint32_t DRV_TMR_AlarmPeriodGet ( DRV_HANDLE handle )
2426  Summary:
2427  Provides the Timer's period.
2428  <p><b>Implementation:</b> Dynamic</p>
2429  Description:
2430  This function gets the Timer's period.
2431  Precondition:
2432  The DRV_TMR_Initialize function must have been called.
2433  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2434  Parameters:
2435  handle - A valid open-instance handle, returned from the driver's
2436  open routine
2437  Returns:
2438  Timer period value:
2439  - a 16 bit value if the timer is configured in 16 bit mode
2440  - a 32 bit value if the timer is configured in 32 bit mode
2441  Example:
2442  <code>
2443  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2444  uint32_t period;
2445  period = DRV_TMR_AlarmPeriodGet ( tmrHandle );
2446  </code>
2447  Remarks:
2448  None.
2449 */
2450 
2451 uint32_t
2453  DRV_HANDLE handle ) ;
2454 // *****************************************************************************
2455 /* Function:
2456  void DRV_TMR_AlarmDeregister ( DRV_HANDLE handle )
2457  Summary:
2458  Removes a previously set alarm.
2459  <p><b>Implementation:</b> Dynamic</p>
2460  Description:
2461  This function removes a previously set alarm.
2462  Precondition:
2463  The DRV_TMR_Initialize function must have been called.
2464  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2465  DRV_TMR_AlarmRegister function must have been called before.
2466  Parameters:
2467  handle - A valid open-instance handle, returned from the driver's
2468  open routine
2469  Returns:
2470  None.
2471  Example:
2472  <code>
2473  // Example of a key debounce check
2474  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
2475  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2476  void keyPressDetect ()
2477  {
2478  // Calculate the count to be passed on from the clock input
2479  DRV_TMR_AlarmRegister ( tmrHandle, 0xFF00, true, DebounceCheck );
2480  }
2481  void DebounceCheck ( uintptr_t context )
2482  {
2483  readKey = AppReadKey();
2484  if ( readKey != lastReadKey )
2485  {
2486  lastReadKey = readKey;
2487  keyCount = 0;
2488  }
2489  else
2490  {
2491  if ( keyCount > 20 )
2492  {
2493  globalKeyState = readKey;
2494  DRV_TMR_AlarmDeregister ( tmrHandle );
2495  }
2496  keyCount++;
2497  }
2498  }
2499  </code>
2500  Remarks:
2501  None.
2502 */
2503 
2504 void
2506  DRV_HANDLE handle ) ;
2507 // *****************************************************************************
2508 // *****************************************************************************
2509 // Section: TMR Driver Operation Control Functions
2510 // *****************************************************************************
2511 // *****************************************************************************
2512 // *****************************************************************************
2513 /* Function:
2514  bool DRV_TMR_Start ( DRV_HANDLE handle )
2515  Summary:
2516  Starts the Timer counting.
2517  <p><b>Implementation:</b> Static/Dynamic</p>
2518  Description:
2519  This function starts the Timer counting.
2520  Precondition:
2521  The DRV_TMR_Initialize function must have been called.
2522  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2523  Timer parameters must have been set by a call to DRV_TMR_AlarmRegister.
2524  Parameters:
2525  handle - A valid open-instance handle, returned from the driver's
2526  open routine
2527  Returns:
2528  - true - if the operation succeeded
2529  - false - the supplied handle is invalid or the client doesn't have
2530  the needed parameters to run (alarm callback and period )
2531  Example:
2532  <code>
2533  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2534  DRV_TMR_AlarmRegister(tmrHandle, 0x100, true, 0, myTmrCallback);
2535  DRV_TMR_Start ( tmrHandle );
2536  </code>
2537  Remarks:
2538  None.
2539 */
2540 
2541 bool
2542  DRV_TMR_Start (
2543  DRV_HANDLE handle ) ;
2544 // *****************************************************************************
2545 /* Function:
2546  void DRV_TMR_Stop ( DRV_HANDLE handle )
2547  Summary:
2548  Stops the Timer from counting.
2549  <p><b>Implementation:</b> Static/Dynamic</p>
2550  Description:
2551  This function stops the running Timer from counting.
2552  Precondition:
2553  The DRV_TMR_Initialize function must have been called.
2554  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2555  Parameters:
2556  handle - A valid open-instance handle, returned from the driver's
2557  open routine
2558  Returns:
2559  None.
2560  Example:
2561  <code>
2562  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2563  DRV_TMR_Stop ( handle );
2564  </code>
2565  Remarks:
2566  None.
2567 */
2568 
2569 void
2570  DRV_TMR_Stop (
2571  DRV_HANDLE handle ) ;
2572 // *****************************************************************************
2573 // *****************************************************************************
2574 // Section: TMR Driver Operation Status Functions
2575 // *****************************************************************************
2576 // *****************************************************************************
2577 // *****************************************************************************
2578 /* Function:
2579  unsigned int DRV_TMR_AlarmHasElapsed ( DRV_HANDLE handle )
2580  Summary:
2581  Provides the status of Timer's period elapse.
2582  <p><b>Implementation:</b> Dynamic</p>
2583  Description:
2584  This function returns the number of times Timer's period has elapsed since
2585  last call to this API has made. On calling this API, the internally
2586  maintained counter will be cleared and count will be started again from next
2587  elapse.
2588  Precondition:
2589  The DRV_TMR_Initialize function must have been called.
2590  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2591  Parameters:
2592  handle - A valid handle, returned from the DRV_TMR_Open
2593  Returns:
2594  Number of times timer has elapsed since the last call.
2595  Example:
2596  <code>
2597  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2598  bool elapseStatus;
2599  SYS_MODULE_OBJ tmrObject // Returned by DRV_TMR_Initialize
2600  unsigned int appInternalTime = 0;
2601  Sys_Tasks()
2602  {
2603  //Timer task will be called from ISR
2604  APP_TimeUpdate_Task();
2605  //Other Tasks
2606  }
2607  void APP_TimeUpdate_Task ( void )
2608  {
2609  //We will not miss a count even though we are late
2610  appInternalTime += DRV_TMR_AlarmHasElapsed ( tmrHandle );
2611  }
2612  </code>
2613  Remarks:
2614  None.
2615 */
2616 
2617 uint32_t
2619  DRV_HANDLE handle ) ;
2620 // *****************************************************************************
2621 // *****************************************************************************
2622 // Section: TMR Driver Control and Information Functions
2623 // *****************************************************************************
2624 // *****************************************************************************
2625 // *****************************************************************************
2626 /* Function:
2627  bool DRV_TMR_ClockSet
2628  (
2629  DRV_HANDLE handle,
2630  DRV_TMR_CLK_SOURCES clockSource,
2631  TMR_PRESCALE preScale
2632  )
2633  Summary:
2634  Sets the timers clock by selecting the source and prescaler.
2635  <p><b>Implementation:</b> Dynamic</p>
2636  Description:
2637  This function sets the timer clock by selecting the source and prescaler.
2638  The clock sources are device specific, refer device datasheet for supported
2639  clock sources. If unsupported clock source is passed then the behaviour of
2640  this function is unpredictable.
2641  Precondition:
2642  The DRV_TMR_Initialize function must have been called. Must have selected
2643  32-Bit timer mode if mode selection is applicable.
2644  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2645  Parameters:
2646  handle - A valid open-instance handle, returned from the driver's
2647  open routine
2648  clockSource - Clock source of the timer
2649  preScale - Timer's Prescaler divisor
2650  Returns:
2651  - true - if the operation is successful
2652  - false - either the handle is invalid or the clockSource
2653  and/or prescaler are not supported
2654  Example:
2655  <code>
2656  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2657  DRV_TMR_ClockSet ( tmrHandle, DRV_TMR_CLKSOURCE_INTERNAL, TMR_PRESCALE_VALUE_256 );
2658  </code>
2659  Remarks:
2660  None.
2661 */
2662 
2663 bool
2665  DRV_HANDLE handle ,
2666  DRV_TMR_CLK_SOURCES clockSource ,
2667  TMR_PRESCALE preScale ) ;
2668 // *****************************************************************************
2669 /* Function:
2670  TMR_PRESCALE DRV_TMR_PrescalerGet ( DRV_HANDLE handle )
2671  Summary:
2672  This function gets the currently selected prescaler.
2673  <p><b>Implementation:</b> Dynamic</p>
2674  Description:
2675  This function gets the currently selected prescaler.
2676  Precondition:
2677  The DRV_TMR_Initialize function must have been called.
2678  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2679  Parameters:
2680  handle - A valid open-instance handle, returned from the driver's
2681  open routine
2682  Returns:
2683  Timer prescaler.
2684  Example:
2685  <code>
2686  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2687  TMR_PRESCALE preScale;
2688  preScale = DRV_TMR_PrescalerGet ( tmrHandle );
2689  </code>
2690  Remarks:
2691  None.
2692 */
2693 
2694 TMR_PRESCALE
2696  DRV_HANDLE handle ) ;
2697 // *****************************************************************************
2698 /* Function:
2699  DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
2700  Summary:
2701  This function gets the currently selected operation mode.
2702  <p><b>Implementation:</b> Dynamic</p>
2703  Description:
2704  This function gets the currently selected 16/32 bit operation mode.
2705  Precondition:
2706  The DRV_TMR_Initialize function must have been called.
2707  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2708  Parameters:
2709  handle - A valid open-instance handle, returned from the driver's
2710  open routine
2711  Returns:
2712  A DRV_TMR_OPERATION_MODE value showing how the timer is currently
2713  configured. DRV_TMR_OPERATION_MODE_NONE is returned for an invalid client
2714  handle.
2715  Example:
2716  <code>
2717  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2718  DRV_TMR_OPERATION_MODE operMode;
2719  operMode = DRV_TMR_OperationModeGet ( tmrHandle );
2720  </code>
2721  Remarks:
2722  None.
2723 */
2724 
2727  DRV_HANDLE handle ) ;
2728 // *****************************************************************************
2729 /* Function:
2730  bool DRV_TMR_GateModeSet ( DRV_HANDLE handle )
2731  Summary:
2732  Enables the Gate mode.
2733  <p><b>Implementation:</b> Dynamic</p>
2734  Description:
2735  This function enables the Gated mode of Timer. User can measure the duration
2736  of an external signal in this mode. Once the Gate mode is enabled, Timer
2737  will start on the raising edge of the external signal. It will keep counting
2738  until the next falling edge.
2739  Precondition:
2740  The DRV_TMR_Initialize function must have been called.
2741  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2742  Parameters:
2743  handle - A valid open-instance handle, returned from the driver's
2744  open routine
2745  Returns:
2746  - true - if the operation is successful
2747  - false - either the handle is invalid or the gate mode
2748  is not supported
2749  Example:
2750  <code>
2751  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2752  DRV_TMR_GateModeSet ( tmrHandle );
2753  </code>
2754  Remarks:
2755  None.
2756 */
2757 
2758 bool
2760  DRV_HANDLE handle ) ;
2761 // *****************************************************************************
2762 /* Function:
2763  bool DRV_TMR_GateModeClear ( DRV_HANDLE handle )
2764  Summary:
2765  Enables the Gate mode.
2766  <p><b>Implementation:</b> Dynamic</p>
2767  Description:
2768  This function enables the Gated mode of Timer. User can measure the duration
2769  of an external signal in this mode. Once the Gate mode is enabled, Timer
2770  will start on the raising edge of the external signal. It will keep counting
2771  until the next falling edge.
2772  Precondition:
2773  The DRV_TMR_Initialize function must have been called.
2774  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2775  Parameters:
2776  handle - A valid open-instance handle, returned from the driver's
2777  open routine
2778  Returns:
2779  - true - if the operation is successful
2780  - false - either the handle is invalid or the gate mode
2781  is not supported
2782  Example:
2783  <code>
2784  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2785  DRV_TMR_GateModeClear ( tmrHandle );
2786  </code>
2787  Remarks:
2788  None.
2789 */
2790 
2791 bool
2793  DRV_HANDLE handle ) ;
2794 // *****************************************************************************
2795 /* Function:
2796  uint32_t DRV_TMR_CounterFrequencyGet ( DRV_HANDLE handle )
2797  Summary:
2798  Provides the Timer input frequency.
2799  <p><b>Implementation:</b> Dynamic</p>
2800  Description:
2801  This function provides the Timer input frequency. Input frequency is the
2802  clock to the Timer register and it is considering the prescaler divisor.
2803  Precondition:
2804  The DRV_TMR_Initialize function must have been called.
2805  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2806  Parameters:
2807  handle - A valid open-instance handle, returned from the driver's
2808  open routine
2809  Returns:
2810  32-bit value corresponding to the running frequency.
2811  If Timer clock source is external, then this function returns 0.
2812  Example:
2813  <code>
2814  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2815  uint32_t clkFreqHz;
2816  clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
2817  </code>
2818  Remarks:
2819  On most processors, the Timer's base frequency is the same as the peripheral
2820  bus clock.
2821 */
2822 
2823 uint32_t
2825  DRV_HANDLE handle ) ;
2826 // *****************************************************************************
2827 /* Function:
2828  DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet
2829  (
2830  DRV_HANDLE handle,
2831  DRV_TMR_DIVIDER_RANGE* pDivRange
2832  )
2833  Summary:
2834  Returns the Timer divider values.
2835  <p><b>Implementation:</b> Dynamic</p>
2836  Description:
2837  This function provides the Timer operating mode and divider range.
2838  Precondition:
2839  The DRV_TMR_Initialize function must have been called.
2840  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2841  Parameters:
2842  handle - A valid open-instance handle, returned from the driver's
2843  open routine
2844  pDivRange - Address to store the timer divider range.
2845  Returns:
2846  - A DRV_TMR_OPERATION_MODE value showing how the timer is currently configured.
2847  The pDivRange is updated with the supported range values.
2848  - DRV_TMR_OPERATION_MODE_NONE for invalid client handle
2849  Example:
2850  <code>
2851  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2852  DRV_TMR_OPERATION_MODE timerMode;
2853  DRV_TMR_DIVIDER_RANGE timerRange;
2854  DRV_TMR_DividerRangeGet(handle, &timerRange);
2855  uint32_t clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
2856  uint32_t maxFreqHz = clkFreqHz / timerRange.dividerMin;
2857  uint32_t minFreqHz = clkFreqHz / timerRange.dividerMax;
2858  </code>
2859  Remarks:
2860  None.
2861 */
2862 
2865  DRV_HANDLE handle ,
2866  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
2867 // *****************************************************************************
2868 // *****************************************************************************
2869 // Section: File includes for the APIs which are required for backward
2870 // compatibility.
2871 // *****************************************************************************
2872 // *****************************************************************************
2873 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h */
2874 /*******************************************************************************
2875  Timer Device Driver Interface Definition
2876  Company:
2877  Microchip Technology Inc.
2878  File Name:
2879  drv_tmr_compatibility.h
2880  Summary:
2881  Timer device driver interface header file.
2882  Description:
2883  This header file contains macro definition for APIs which will be deprecated
2884  later. This header file is included in drv_tmr.h.
2885 *******************************************************************************/
2886 //DOM-IGNORE-BEGIN
2887 /*******************************************************************************
2888 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
2889 Microchip licenses to you the right to use, modify, copy and distribute
2890 Software only when embedded on a Microchip microcontroller or digital signal
2891 controller that is integrated into your product or third party product
2892 (pursuant to the sublicense terms in the accompanying license agreement).
2893 You should refer to the license agreement accompanying this Software for
2894 additional information regarding your rights and obligations.
2895 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
2896 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
2897 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
2898 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
2899 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
2900 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
2901 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
2902 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
2903 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
2904 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
2905 *******************************************************************************/
2906 //DOM-IGNORE-END
2907 #ifndef _DRV_TMR_DEPRECATED_H
2908 #define _DRV_TMR_DEPRECATED_H
2909 // *****************************************************************************
2910 // *****************************************************************************
2911 // Section: File includes
2912 // *****************************************************************************
2913 // *****************************************************************************
2914 // *****************************************************************************
2915 /* Function:
2916  void DRV_TMR_Tasks_ISR ( SYS_MODULE_OBJ object )
2917  Summary:
2918  Maintains the driver's state machine, processes the events and implements
2919  its ISR.
2920  <p><b>Implementation:</b> Dynamic</p>
2921  Description:
2922  This function is used to maintain the driver's internal state machine and
2923  processes the timer events in interrupt-driven implementations
2924  (DRV_TMR_INTERRUPT_MODE == true).
2925  Precondition:
2926  The DRV_TMR_Initialize function must have been called for the specified Timer
2927  driver instance.
2928  Parameters:
2929  object - Object handle for the specified driver instance (returned from
2930  DRV_TMR_Initialize)
2931  Returns:
2932  None
2933  Example:
2934  <code>
2935  void __ISR(_TIMER_2_VECTOR, ipl4) _InterruptHandler_TMR2(void)
2936  {
2937  DRV_TMR_Tasks_ISR(appDrvObjects.drvTmrObject);
2938  }
2939  </code>
2940  Remarks:
2941  This function is normally not called directly by an application.
2942  It is called by the timer driver raw ISR.
2943  This function will execute in an ISR context and will never block or access any
2944  resources that may cause it to block.
2945 
2946  This function will be deprecated later, so avoid using it as much as possible.
2947  Use generic function "DRV_TMR_Tasks" instead of this.
2948 */
2949 #define DRV_TMR_Tasks_ISR( object ) DRV_TMR_Tasks ( object )
2950 // *****************************************************************************
2951 /* Function:
2952  void DRV_TMR_CounterValue16BitSet
2953  (
2954  DRV_HANDLE handle,
2955  uint16_t counterPeriod
2956  )
2957  Summary:
2958  Updates the 16-bit Timer's counter register.
2959  <p><b>Implementation:</b> Dynamic</p>
2960  Description:
2961  This function updates the 16-bit Timer's value in the counter register. This
2962  is valid only if the 16-bit mode of the timer is selected('mode' in the INIT
2963  structure is set to DRV_TMR_OPERATION_MODE_16_BIT). Otherwise use
2964  DRV_TMR_CounterValue32BitSet function.
2965  Precondition:
2966  The DRV_TMR_Initialize function must have been called. Must have selected
2967  16-Bit timer mode if mode selection is applicable.
2968  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2969  Parameters:
2970  handle - A valid open-instance handle, returned from the driver's
2971  open routine
2972  counterPeriod - 16-bit counter period value
2973  Returns:
2974  None.
2975  Example:
2976  <code>
2977  //Example to use timer for precision time measurement
2978  //without configuring an alarm (interrupt based)
2979  char appState = 0;
2980  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2981 
2982  switch ( appState )
2983  {
2984  case 0:
2985  //Calculate and set the counter period
2986  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
2987 
2988  //counter starts
2989  DRV_TMR_Start ( tmrHandle );
2990 
2991  //Trigger an application operation
2992  app_trigger_operation();
2993 
2994  //Check for time-out in the next state
2995  appState++;
2996  case 1:
2997  //Overflows and stops at 0 if no alarm is set
2998  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
2999  {
3000  //Time-out
3001  return false;
3002  }
3003  else if ( app_operation_isComplete( ) )
3004  {
3005  //Operation is complete before time-out
3006  return true;
3007  }
3008  </code>
3009  Remarks:
3010  This function will be deprecated later, so avoid using it as much as possible.
3011  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3012 */
3013 #define DRV_TMR_CounterValue16BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3014 // *****************************************************************************
3015 /* Function:
3016  void DRV_TMR_CounterValue32BitSet
3017  (
3018  DRV_HANDLE handle,
3019  uint32_t counterPeriod
3020  )
3021  Summary:
3022  Updates the 32-bit Timer's counter register.
3023  <p><b>Implementation:</b> Dynamic</p>
3024  Description:
3025  This function updates the 32-bit Timer's value in the counter register. This
3026  is valid only if the 32-bit mode of the timer is selected Otherwise use
3027  DRV_TMR_CounterValue16BitSet function.
3028  Precondition:
3029  The DRV_TMR_Initialize function must have been called. Must have selected
3030  32-Bit timer mode.
3031  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3032  Parameters:
3033  handle - A valid open-instance handle, returned from the driver's
3034  open routine
3035  counterPeriod - 32-bit counter period value
3036  Returns:
3037  None.
3038  Example:
3039  <code>
3040  //Example to use timer for precision time measurement
3041  //without configuring an alarm (interrupt based)
3042  char appState = 0;
3043  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3044 
3045  switch ( appState )
3046  {
3047  case 0:
3048  //Calculate and set the counter period
3049  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0xFF343100 ) );
3050 
3051  //counter starts
3052  DRV_TMR_Start ( tmrHandle );
3053 
3054  //Trigger an application operation against which we want to use the time-out
3055  app_trigger_operation();
3056 
3057  //Check for time-out in the next state
3058  appState++;
3059  case 1:
3060  //Overflows and stops at 0 if no alarm is set
3061  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3062  {
3063  //Time-out
3064  return false;
3065  }
3066  else if ( app_operation_isComplete( ) )
3067  {
3068  //Operation is complete before time-out
3069  return true;
3070  }
3071  </code>
3072  Remarks:
3073  In most of the devices only even numbered instances of timer supports
3074  32-bit mode.
3075  This function will be deprecated later, so avoid using it as much as possible.
3076  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3077 */
3078 #define DRV_TMR_CounterValue32BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3079 // *****************************************************************************
3080 /* Function:
3081  uint16_t DRV_TMR_CounterValue16BitGet ( DRV_HANDLE handle )
3082  Summary:
3083  Reads the 16-bit Timer's counter register.
3084  <p><b>Implementation:</b> Dynamic</p>
3085  Description:
3086  This function returns the 16-bit Timer's value in the counter register. This
3087  is valid only if the 16-bit mode of the timer is selected.
3088  Otherwise use DRV_TMR_CounterValue32BitGet function.
3089  Precondition:
3090  The DRV_TMR_Initialize function must have been called. Must have selected
3091  16-Bit timer mode if mode selection is applicable.
3092  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3093  Parameters:
3094  handle - A valid open-instance handle, returned from the driver's
3095  open routine
3096 
3097  Returns:
3098  Timer period in 16-bit mode.
3099  Example:
3100  <code>
3101  //Example to use timer for precision time measurement
3102  //without configuring an alarm (interrupt based)
3103  char appState = 0;
3104  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3105 
3106  switch ( appState )
3107  {
3108  case 0:
3109  //Calculate and set the counter period
3110  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
3111 
3112  //counter starts
3113  DRV_TMR_Start ( tmrHandle );
3114 
3115  //Trigger an application operation
3116  app_trigger_operation();
3117 
3118  //Check for time-out in the next state
3119  appState++;
3120  case 1:
3121  //Overflows and stops at 0 if no alarm is set
3122  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3123  {
3124  //Time-out
3125  return false;
3126  }
3127  else if ( app_operation_isComplete( ) )
3128  {
3129  //Operation is complete before time-out
3130  return true;
3131  }
3132  </code>
3133  Remarks:
3134  This function will be deprecated later, so avoid using it as much as possible.
3135  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3136 */
3137 #define DRV_TMR_CounterValue16BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3138 // *****************************************************************************
3139 /* Function:
3140  uint32_t DRV_TMR_CounterValue32BitGet ( DRV_HANDLE handle )
3141  Summary:
3142  Reads the 32-bit Timer's counter register.
3143  <p><b>Implementation:</b> Dynamic</p>
3144  Description:
3145  This function returns the 32-bit Timer's value in the counter register. This
3146  is valid only if the 32-bit mode of the timer is selected Otherwise use
3147  DRV_TMR_CounterValue16BitGet function.
3148  Precondition:
3149  The DRV_TMR_Initialize function must have been called. Must have selected
3150  32-Bit timer mode.
3151  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3152  Parameters:
3153  handle - A valid open-instance handle, returned from the driver's
3154  open routine
3155 
3156  Returns:
3157  32-Bit Counter value.
3158  Example:
3159  <code>
3160  //Example to use timer for precision time measurement
3161  //without configuring an alarm (interrupt based)
3162  char appState = 0;
3163  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3164 
3165  switch ( appState )
3166  {
3167  case 0:
3168  //Calculate and set the counter period
3169  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0x23321000 ) );
3170 
3171  //counter starts
3172  DRV_TMR_Start ( tmrHandle );
3173 
3174  //Trigger an application operation
3175  app_trigger_operation();
3176 
3177  //Check for time-out in the next state
3178  appState++;
3179  case 1:
3180  //Overflows and stops at 0 if no alarm is set
3181  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3182  {
3183  //Time-out
3184  return false;
3185  }
3186  else if ( app_operation_isComplete( ) )
3187  {
3188  //Operation is complete before time-out
3189  return true;
3190  }
3191  </code>
3192  Remarks:
3193  In most of the devices only even numbered instances of timer supports
3194  32-bit mode.
3195  This function will be deprecated later, so avoid using it as much as possible.
3196  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3197 */
3198 #define DRV_TMR_CounterValue32BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3199 // *****************************************************************************
3200 /* Function:
3201  void DRV_TMR_Alarm16BitRegister
3202  (
3203  DRV_HANDLE handle,
3204  uint16_t period,
3205  bool isPeriodic,
3206  uintptr_t context,
3207  DRV_TMR_CALLBACK callBack
3208  )
3209  Summary:
3210  Sets up an alarm.
3211  <p><b>Implementation:</b> Dynamic</p>
3212  Description:
3213  This function sets up an alarm, allowing the client to receive a callback
3214  from the driver when the counter period elapses. Alarms can be one-shot or
3215  periodic. This API is valid only if the 16-bit mode of the timer is
3216  selected. Otherwise use DRV_TMR_Alarm32BitRegister function.
3217  Precondition:
3218  The DRV_TMR_Initialize function must have been called. Must have selected
3219  16-Bit timer mode if mode selection is applicable.
3220  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3221  Parameters:
3222  handle - A valid handle, returned from DRV_TMR_Open
3223  period - 16-bit period which will be loaded into the Timer hardware register.
3224 
3225  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3226 
3227  context - A reference, call back function will be called with the same
3228  reference.
3229 
3230  callBack - A call back function which will be called on period elapse.
3231 
3232  Returns:
3233  None
3234  Example:
3235  <code>
3236  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3237 
3238  void setupTask ()
3239  {
3240  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3241 
3242  // Calculate the count to be passed on from the clock input
3243  //Periodically toggle LED
3244  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF40, true, 0,
3245  ToggleLedCallBack );
3246  }
3247 
3248  void ToggleLedCallBack ( uintptr_t context )
3249  {
3250  //Toggle
3251  }
3252  </code>
3253  Remarks:
3254  This function will be deprecated later, so avoid using it as much as possible.
3255  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3256 */
3257 #define DRV_TMR_Alarm16BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3258 // *****************************************************************************
3259 /* Function:
3260  void DRV_TMR_Alarm32BitRegister
3261  (
3262  DRV_HANDLE handle,
3263  uint32_t period,
3264  bool isPeriodic,
3265  uintptr_t context,
3266  DRV_TMR_CALLBACK callBack
3267  )
3268  Summary:
3269  Sets up an alarm.
3270  <p><b>Implementation:</b> Dynamic</p>
3271  Description:
3272  This function sets up an alarm, allowing the client to receive a callback
3273  from the driver when the counter period elapses. Alarms can be one-shot or
3274  periodic. This API is valid only if the 32-bit mode of the timer is
3275  selected Otherwise use DRV_TMR_Alarm16BitRegister function.
3276  Precondition:
3277  The DRV_TMR_Initialize function must have been called. Must have selected
3278  32-Bit timer mode.
3279  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3280  Parameters:
3281  handle - A valid handle, returned from DRV_TMR_Open
3282  period - 32-bit period which will be loaded into the Timer hardware register.
3283 
3284  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3285 
3286  context - A reference, call back function will be called with the same
3287  reference.
3288 
3289  callBack - A call back function which will be called on period elapse.
3290 
3291  Returns:
3292  None
3293  Example:
3294  <code>
3295  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3296 
3297  void setupTask ()
3298  {
3299  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3300 
3301  // Calculate the count to be passed on from the clock input
3302  //Periodically toggle LED
3303  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFFFFFF00, true, 0,
3304  ToggleLedCallBack );
3305  }
3306 
3307  void ToggleLedCallBack ( uintptr_t context )
3308  {
3309  //Toggle
3310  }
3311  </code>
3312  Remarks:
3313  In most of the devices only even numbered instances of timer supports
3314  32-bit mode.
3315  This function will be deprecated later, so avoid using it as much as possible.
3316  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3317 */
3318 #define DRV_TMR_Alarm32BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3319 // *****************************************************************************
3320 /* Function:
3321  void DRV_TMR_AlarmPeriod16BitSet ( DRV_HANDLE handle, uint16_t value )
3322  Summary:
3323  Updates the 16-bit Timer's period.
3324  <p><b>Implementation:</b> Dynamic</p>
3325  Description:
3326  This function updates the 16-bit Timer's period. This API is valid only if
3327  the 16-bit mode of the timer is selected
3328  Otherwise use DRV_TMR_AlarmPeriod32BitSet function.
3329  Precondition:
3330  The DRV_TMR_Initialize function must have been called. Must have selected
3331  16-Bit timer mode if mode selection is applicable.
3332  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3333  Parameters:
3334  handle - A valid open-instance handle, returned from the driver's
3335  open routine
3336  value - 16-bit Period value
3337  Returns:
3338  None.
3339  Example:
3340  <code>
3341  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3342  DRV_TMR_AlarmPeriod16BitSet ( handle, 0x1000 );
3343  </code>
3344  Remarks:
3345  This function will be deprecated later, so avoid using it as much as possible.
3346  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3347 */
3348 #define DRV_TMR_AlarmPeriod16BitSet( handle , value ) DRV_TMR_AlarmPeriodSet ( handle , value )
3349 // *****************************************************************************
3350 /* Function:
3351  void DRV_TMR_AlarmPeriod32BitSet ( DRV_HANDLE handle, uint32_t period )
3352  Summary:
3353  Updates the 32-bit Timer's period.
3354  <p><b>Implementation:</b> Dynamic</p>
3355  Description:
3356  This function updates the 32-bit Timer's period. This API is valid only if
3357  the 32-bit mode of the timer is selected
3358  Otherwise use DRV_TMR_AlarmPeriod16BitSet function.
3359  Precondition:
3360  The DRV_TMR_Initialize unction must have been called. Must have selected
3361  32-Bit timer mode.
3362  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3363  Parameters:
3364  handle - A valid open-instance handle, returned from the driver's
3365  open routine
3366  period - 32-bit Period value
3367  Returns:
3368  None.
3369  Example:
3370  <code>
3371  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3372  DRV_TMR_AlarmPeriod32BitSet ( handle, 0xFFFFFF00 );
3373  </code>
3374  Remarks:
3375  In most of the devices only even numbered instances of timer supports
3376  32-bit mode.
3377  This function will be deprecated later, so avoid using it as much as possible.
3378  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3379 */
3380 #define DRV_TMR_AlarmPeriod32BitSet( handle , period ) DRV_TMR_AlarmPeriodSet ( handle , period )
3381 // *****************************************************************************
3382 /* Function:
3383  uint16_t DRV_TMR_AlarmPeriod16BitGet ( DRV_HANDLE handle )
3384  Summary:
3385  Provides the 16-bit Timer's period.
3386  <p><b>Implementation:</b> Dynamic</p>
3387  Description:
3388  This function gets the 16-bit Timer's period. This API is valid only if
3389  the 16-bit mode of the timer is selected.
3390  Otherwise use DRV_TMR_AlarmPeriod32BitGet function.
3391  Precondition:
3392  The DRV_TMR_Initialize function must have been called. Must have selected
3393  16-Bit timer mode if mode selection is applicable.
3394  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3395  Parameters:
3396  handle - A valid open-instance handle, returned from the driver's
3397  open routine
3398  Returns:
3399  16-bit timer period value
3400  Example:
3401  <code>
3402  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3403  uint16_t period;
3404 
3405  period = DRV_TMR_AlarmPeriod16BitGet ( tmrHandle );
3406  </code>
3407  Remarks:
3408  This function will be deprecated later, so avoid using it as much as possible.
3409  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3410 */
3411 #define DRV_TMR_AlarmPeriod16BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3412 // *****************************************************************************
3413 /* Function:
3414  uint32_t DRV_TMR_AlarmPeriod32BitGet ( DRV_HANDLE handle )
3415  Summary:
3416  Provides the 32-bit Timer's period.
3417  <p><b>Implementation:</b> Dynamic</p>
3418  Description:
3419  This function gets the 32-bit Timer's period. This API is valid only if
3420  the 32-bit mode of the timer is selected
3421  Otherwise use DRV_TMR_AlarmPeriod16BitGet function.
3422  Precondition:
3423  The DRV_TMR_Initialize function must have been called. Must have selected
3424  32-Bit timer mode.
3425  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3426  Parameters:
3427  handle - A valid open-instance handle, returned from the driver's
3428  open routine
3429  Returns:
3430  32-bit Timer period value.
3431  Example:
3432  <code>
3433  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3434  uint32_t period;
3435  period = DRV_TMR_AlarmPeriod32BitGet ( handle );
3436  </code>
3437  Remarks:
3438  In most of the devices only even numbered instances of timer supports
3439  32-bit mode.
3440  This function will be deprecated later, so avoid using it as much as possible.
3441  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3442 */
3443 #define DRV_TMR_AlarmPeriod32BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3444 // *****************************************************************************
3445 /* Function:
3446  void DRV_TMR_Alarm16BitDeregister ( DRV_HANDLE handle )
3447  Summary:
3448  Removes a previously set alarm.
3449  <p><b>Implementation:</b> Dynamic</p>
3450  Description:
3451  This function removes a previously set alarm. This API is valid only if
3452  the 16-bit mode of the timer is selected
3453  Otherwise use DRV_TMR_Alarm32BitDeregister function.
3454  Precondition:
3455  The DRV_TMR_Initialize function must have been called. Must have selected
3456  16-Bit timer mode if mode selection is applicable.
3457  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3458 
3459  DRV_TMR_Alarm16BitRegister function must have been called before.
3460  Parameters:
3461  handle - A valid open-instance handle, returned from the driver's
3462  open routine
3463  Returns:
3464  None.
3465  Example:
3466  <code>
3467  //Example of a key debounce check
3468 
3469  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3470  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3471  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3472 
3473  void keyPressDetect ()
3474  {
3475  // Calculate the count to be passed on from the clock input
3476  //Periodically toggle LED
3477  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF00, true,
3478  DebounceCheck );
3479  }
3480 
3481  void DebounceCheck ( uintptr_t context )
3482  {
3483  readKey = AppReadKey();
3484 
3485  if ( readKey != lastReadKey )
3486  {
3487  lastReadKey = readKey;
3488  keyCount = 0;
3489  }
3490  else
3491  {
3492  if ( keyCount > 20 )
3493  {
3494  globalKeyState = readKey;
3495  DRV_TMR_Alarm16BitDeregister ( tmrHandle );
3496  }
3497  keyCount++;
3498  }
3499  }
3500  </code>
3501  Remarks:
3502  This function will be deprecated later, so avoid using it as much as possible.
3503  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3504 */
3505 #define DRV_TMR_Alarm16BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3506 // *****************************************************************************
3507 /* Function:
3508  void DRV_TMR_Alarm32BitDeregister ( DRV_HANDLE handle )
3509  Summary:
3510  Removes a previously set alarm.
3511  <p><b>Implementation:</b> Dynamic</p>
3512  Description:
3513  This function removes a previously set alarm. This API is valid only if
3514  the 32-bit mode of the timer is selected
3515  Otherwise use DRV_TMR_Alarm16BitDeregister function.
3516  Precondition:
3517  The DRV_TMR_Initialize function must have been called. Must have selected
3518  32-Bit timer mode if mode selection is applicable.
3519  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3520 
3521  DRV_TMR_Alarm32BitRegister function must have been called before.
3522  Parameters:
3523  handle - A valid open-instance handle, returned from the driver's
3524  open routine
3525  Returns:
3526  None.
3527  Example:
3528  <code>
3529  //Example of a key debounce check
3530 
3531  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3532  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3533  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3534 
3535  void keyPressDetect ( void )
3536  {
3537  // Calculate the count to be passed on from the clock input
3538  //Periodically check the key status
3539  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFF0FFD20, true, 0,
3540  DebounceCheck );
3541  }
3542 
3543  void DebounceCheck ( uintptr_t context )
3544  {
3545  readKey = AppReadKey();
3546 
3547  if ( readKey != lastReadKey )
3548  {
3549  lastReadKey = readKey;
3550  keyCount = 0;
3551  }
3552  else
3553  {
3554  if ( keyCount > 20 )
3555  {
3556  //Key is stable now
3557  globalKeyState = readKey;
3558  DRV_TMR_Alarm32BitDeregister ( tmrHandle );
3559  }
3560  keyCount++;
3561  }
3562  }
3563  </code>
3564  Remarks:
3565  In most of the devices only even numbered instances of timer supports
3566  32-bit mode.
3567  This function will be deprecated later, so avoid using it as much as possible.
3568  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3569 */
3570 #define DRV_TMR_Alarm32BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3571  // #ifndef _DRV_TMR_DEPRECATED_H
3572 /*******************************************************************************
3573  End of File
3574 */
3575 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h*/
3576 /* CLOSE_FILE Include File */
3577 
3578 //DOM-IGNORE-BEGIN
3579 //DOM-IGNORE-END
3580  // #ifndef _DRV_TMR_H
3581 /*******************************************************************************
3582  End of File
3583 */
3584 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h*/
3585 /* CLOSE_FILE Include File */
3586 
3587 #include "peripheral/tmr/plib_tmr.h"
3588 #include "peripheral/int/plib_int.h"
3589 // maximum divider value for 32 bit operation mode
3590 #define DRV_TIMER_DIVIDER_MAX_32BIT 0xffffffff
3591 // minimum divider value for 32 bit operation mode
3592 #define DRV_TIMER_DIVIDER_MIN_32BIT 0x2
3593 // maximum divider value for 16 bit operation mode
3594 #define DRV_TIMER_DIVIDER_MAX_16BIT 0x10000
3595 // minimum divider value for 16 bit operation mode
3596 #define DRV_TIMER_DIVIDER_MIN_16BIT 0x2
3597 // *****************************************************************************
3598 // *****************************************************************************
3599 // Section: Interface Headers for Instance 0 for the static driver
3600 // *****************************************************************************
3601 // *****************************************************************************
3602 
3603 void
3604  DRV_TMR0_Initialize ( void ) ;
3605 
3606 bool
3607  DRV_TMR0_Start ( void ) ;
3608 
3609 void
3610  DRV_TMR0_Stop ( void ) ;
3611 
3612 static inline void
3614  {
3615  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 0))); /* 37 */
3616  DRV_TMR0_Stop () ;
3617  ((int)(bitmapstruct.element0 |= (1 << 1))); /* 30 */
3618  UART_71zqendz ( 2 ) ; /* 30 */
3619  }
3620 
3621 static inline SYS_STATUS
3623 {
3624  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 2))); /* 37 */
3625  /* Return the status as ready always */
3626  ((int)(bitmapstruct.element0 |= (1 << 3))); /* 30 */
3627  UART_71zqendz ( 4 ) ; /* 30 */
3628  return
3629  SYS_STATUS_READY ;
3630 }
3631 
3632 static inline void
3633  DRV_TMR0_Open ( void )
3634  {
3635  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 4))); /* 37 */
3636  ((int)(bitmapstruct.element0 |= (1 << 5))); /* 30 */
3637  UART_71zqendz ( 6 ) ; /* 30 */
3638  }
3639 
3641  DRV_TMR0_ClientStatus ( void ) ;
3642 
3643 static inline DRV_TMR_OPERATION_MODE
3645 {
3646  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 6))); /* 37 */
3647  ((int)(bitmapstruct.element0 |= (1 << 7))); /* 30 */
3648  UART_71zqendz ( 8 ) ; /* 30 */
3649  return
3651 }
3652 
3653 static inline void
3655  {
3656  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 8))); /* 37 */
3657  DRV_TMR0_Stop () ;
3658  ((int)(bitmapstruct.element0 |= (1 << 9))); /* 30 */
3659  UART_71zqendz ( 10 ) ; /* 30 */
3660  }
3661 
3662 bool
3664  DRV_TMR_CLK_SOURCES clockSource ,
3665  TMR_PRESCALE prescale ) ;
3666 
3667 void
3669  uint32_t value ) ;
3670 
3671 uint32_t
3672  DRV_TMR0_CounterValueGet ( void ) ;
3673 
3674 void
3675  DRV_TMR0_CounterClear ( void ) ;
3676 
3677 TMR_PRESCALE
3678  DRV_TMR0_PrescalerGet ( void ) ;
3679 
3680 void
3682  uint32_t value ) ;
3683 
3684 uint32_t
3685  DRV_TMR0_PeriodValueGet ( void ) ;
3686 
3687 void
3688  DRV_TMR0_StopInIdleDisable ( void ) ;
3689 
3690 void
3691  DRV_TMR0_StopInIdleEnable ( void ) ;
3692 
3693 static inline void
3695  {
3696  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 10))); /* 37 */
3697  ((int)(bitmapstruct.element0 |= (1 << 11))); /* 30 */
3698  UART_71zqendz ( 12 ) ; /* 30 */
3699  }
3700 
3701 uint32_t
3702  DRV_TMR0_CounterFrequencyGet ( void ) ;
3703 
3706  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3707 // *****************************************************************************
3708 // *****************************************************************************
3709 // Section: Interface Headers for Instance 1 for the static driver
3710 // *****************************************************************************
3711 // *****************************************************************************
3712 
3713 void
3714  DRV_TMR1_Initialize ( void ) ;
3715 
3716 bool
3717  DRV_TMR1_Start ( void ) ;
3718 
3719 void
3720  DRV_TMR1_Stop ( void ) ;
3721 
3722 static inline void
3724  {
3725  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 12))); /* 37 */
3726  DRV_TMR1_Stop () ;
3727  ((int)(bitmapstruct.element0 |= (1 << 13))); /* 30 */
3728  UART_71zqendz ( 14 ) ; /* 30 */
3729  }
3730 
3731 static inline SYS_STATUS
3733 {
3734  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 14))); /* 37 */
3735  /* Return the status as ready always */
3736  ((int)(bitmapstruct.element0 |= (1 << 15))); /* 30 */
3737  UART_71zqendz ( 16 ) ; /* 30 */
3738  return
3739  SYS_STATUS_READY ;
3740 }
3741 
3742 static inline void
3743  DRV_TMR1_Open ( void )
3744  {
3745  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 16))); /* 37 */
3746  ((int)(bitmapstruct.element0 |= (1 << 17))); /* 30 */
3747  UART_71zqendz ( 18 ) ; /* 30 */
3748  }
3749 
3751  DRV_TMR1_ClientStatus ( void ) ;
3752 
3753 static inline DRV_TMR_OPERATION_MODE
3755 {
3756  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 18))); /* 37 */
3757  ((int)(bitmapstruct.element0 |= (1 << 19))); /* 30 */
3758  UART_71zqendz ( 20 ) ; /* 30 */
3759  return
3761 }
3762 
3763 static inline void
3765  {
3766  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 20))); /* 37 */
3767  DRV_TMR1_Stop () ;
3768  ((int)(bitmapstruct.element0 |= (1 << 21))); /* 30 */
3769  UART_71zqendz ( 22 ) ; /* 30 */
3770  }
3771 
3772 bool
3774  DRV_TMR_CLK_SOURCES clockSource ,
3775  TMR_PRESCALE prescale ) ;
3776 
3777 void
3779  uint32_t value ) ;
3780 
3781 uint32_t
3782  DRV_TMR1_CounterValueGet ( void ) ;
3783 
3784 void
3785  DRV_TMR1_CounterClear ( void ) ;
3786 
3787 TMR_PRESCALE
3788  DRV_TMR1_PrescalerGet ( void ) ;
3789 
3790 void
3792  uint32_t value ) ;
3793 
3794 uint32_t
3795  DRV_TMR1_PeriodValueGet ( void ) ;
3796 
3797 void
3798  DRV_TMR1_StopInIdleDisable ( void ) ;
3799 
3800 void
3801  DRV_TMR1_StopInIdleEnable ( void ) ;
3802 
3803 static inline void
3805  {
3806  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 22))); /* 37 */
3807  ((int)(bitmapstruct.element0 |= (1 << 23))); /* 30 */
3808  UART_71zqendz ( 24 ) ; /* 30 */
3809  }
3810 
3811 uint32_t
3812  DRV_TMR1_CounterFrequencyGet ( void ) ;
3813 
3816  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3817 // *****************************************************************************
3818 // *****************************************************************************
3819 // Section: Interface Headers for Instance 2 for the static driver
3820 // *****************************************************************************
3821 // *****************************************************************************
3822 
3823 void
3824  DRV_TMR2_Initialize ( void ) ;
3825 
3826 bool
3827  DRV_TMR2_Start ( void ) ;
3828 
3829 void
3830  DRV_TMR2_Stop ( void ) ;
3831 
3832 static inline void
3834  {
3835  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 24))); /* 37 */
3836  DRV_TMR2_Stop () ;
3837  ((int)(bitmapstruct.element0 |= (1 << 25))); /* 30 */
3838  UART_71zqendz ( 26 ) ; /* 30 */
3839  }
3840 
3841 static inline SYS_STATUS
3843 {
3844  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 26))); /* 37 */
3845  /* Return the status as ready always */
3846  ((int)(bitmapstruct.element0 |= (1 << 27))); /* 30 */
3847  UART_71zqendz ( 28 ) ; /* 30 */
3848  return
3849  SYS_STATUS_READY ;
3850 }
3851 
3852 static inline void
3853  DRV_TMR2_Open ( void )
3854  {
3855  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 28))); /* 37 */
3856  ((int)(bitmapstruct.element0 |= (1 << 29))); /* 30 */
3857  UART_71zqendz ( 30 ) ; /* 30 */
3858  }
3859 
3861  DRV_TMR2_ClientStatus ( void ) ;
3862 
3863 static inline DRV_TMR_OPERATION_MODE
3865 {
3866  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 30))); /* 37 */
3867  ((int)(bitmapstruct.element0 |= (1 << 31))); /* 30 */
3868  UART_71zqendz ( 32 ) ; /* 30 */
3869  return
3871 }
3872 
3873 static inline void
3875  {
3876  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 0))); /* 37 */
3877  DRV_TMR2_Stop () ;
3878  ((int)(bitmapstruct.element1 |= (1 << 1))); /* 30 */
3879  UART_71zqendz ( 34 ) ; /* 30 */
3880  }
3881 
3882 bool
3884  DRV_TMR_CLK_SOURCES clockSource ,
3885  TMR_PRESCALE prescale ) ;
3886 
3887 void
3889  uint32_t value ) ;
3890 
3891 uint32_t
3892  DRV_TMR2_CounterValueGet ( void ) ;
3893 
3894 void
3895  DRV_TMR2_CounterClear ( void ) ;
3896 
3897 TMR_PRESCALE
3898  DRV_TMR2_PrescalerGet ( void ) ;
3899 
3900 void
3902  uint32_t value ) ;
3903 
3904 uint32_t
3905  DRV_TMR2_PeriodValueGet ( void ) ;
3906 
3907 void
3908  DRV_TMR2_StopInIdleDisable ( void ) ;
3909 
3910 void
3911  DRV_TMR2_StopInIdleEnable ( void ) ;
3912 
3913 static inline void
3915  {
3916  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 2))); /* 37 */
3917  ((int)(bitmapstruct.element1 |= (1 << 3))); /* 30 */
3918  UART_71zqendz ( 36 ) ; /* 30 */
3919  }
3920 
3921 uint32_t
3922  DRV_TMR2_CounterFrequencyGet ( void ) ;
3923 
3926  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3927 // *****************************************************************************
3928 // *****************************************************************************
3929 // Section: Interface Headers for Instance 3 for the static driver
3930 // *****************************************************************************
3931 // *****************************************************************************
3932 
3933 void
3934  DRV_TMR3_Initialize ( void ) ;
3935 
3936 bool
3937  DRV_TMR3_Start ( void ) ;
3938 
3939 void
3940  DRV_TMR3_Stop ( void ) ;
3941 
3942 static inline void
3944  {
3945  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 4))); /* 37 */
3946  DRV_TMR3_Stop () ;
3947  ((int)(bitmapstruct.element1 |= (1 << 5))); /* 30 */
3948  UART_71zqendz ( 38 ) ; /* 30 */
3949  }
3950 
3951 static inline SYS_STATUS
3953 {
3954  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 6))); /* 37 */
3955  /* Return the status as ready always */
3956  ((int)(bitmapstruct.element1 |= (1 << 7))); /* 30 */
3957  UART_71zqendz ( 40 ) ; /* 30 */
3958  return
3959  SYS_STATUS_READY ;
3960 }
3961 
3962 static inline void
3963  DRV_TMR3_Open ( void )
3964  {
3965  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 8))); /* 37 */
3966  ((int)(bitmapstruct.element1 |= (1 << 9))); /* 30 */
3967  UART_71zqendz ( 42 ) ; /* 30 */
3968  }
3969 
3971  DRV_TMR3_ClientStatus ( void ) ;
3972 
3973 static inline DRV_TMR_OPERATION_MODE
3975 {
3976  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 10))); /* 37 */
3977  ((int)(bitmapstruct.element1 |= (1 << 11))); /* 30 */
3978  UART_71zqendz ( 44 ) ; /* 30 */
3979  return
3981 }
3982 
3983 static inline void
3985  {
3986  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 12))); /* 37 */
3987  DRV_TMR3_Stop () ;
3988  ((int)(bitmapstruct.element1 |= (1 << 13))); /* 30 */
3989  UART_71zqendz ( 46 ) ; /* 30 */
3990  }
3991 
3992 bool
3994  DRV_TMR_CLK_SOURCES clockSource ,
3995  TMR_PRESCALE prescale ) ;
3996 
3997 void
3999  uint32_t value ) ;
4000 
4001 uint32_t
4002  DRV_TMR3_CounterValueGet ( void ) ;
4003 
4004 void
4005  DRV_TMR3_CounterClear ( void ) ;
4006 
4007 TMR_PRESCALE
4008  DRV_TMR3_PrescalerGet ( void ) ;
4009 
4010 void
4012  uint32_t value ) ;
4013 
4014 uint32_t
4015  DRV_TMR3_PeriodValueGet ( void ) ;
4016 
4017 void
4018  DRV_TMR3_StopInIdleDisable ( void ) ;
4019 
4020 void
4021  DRV_TMR3_StopInIdleEnable ( void ) ;
4022 
4023 static inline void
4025  {
4026  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 14))); /* 37 */
4027  ((int)(bitmapstruct.element1 |= (1 << 15))); /* 30 */
4028  UART_71zqendz ( 48 ) ; /* 30 */
4029  }
4030 
4031 uint32_t
4032  DRV_TMR3_CounterFrequencyGet ( void ) ;
4033 
4036  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4037 // *****************************************************************************
4038 // *****************************************************************************
4039 // Section: Interface Headers for Instance 4 for the static driver
4040 // *****************************************************************************
4041 // *****************************************************************************
4042 
4043 void
4044  DRV_TMR4_Initialize ( void ) ;
4045 
4046 bool
4047  DRV_TMR4_Start ( void ) ;
4048 
4049 void
4050  DRV_TMR4_Stop ( void ) ;
4051 
4052 static inline void
4054  {
4055  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 16))); /* 37 */
4056  DRV_TMR4_Stop () ;
4057  ((int)(bitmapstruct.element1 |= (1 << 17))); /* 30 */
4058  UART_71zqendz ( 50 ) ; /* 30 */
4059  }
4060 
4061 static inline SYS_STATUS
4063 {
4064  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 18))); /* 37 */
4065  /* Return the status as ready always */
4066  ((int)(bitmapstruct.element1 |= (1 << 19))); /* 30 */
4067  UART_71zqendz ( 52 ) ; /* 30 */
4068  return
4069  SYS_STATUS_READY ;
4070 }
4071 
4072 static inline void
4073  DRV_TMR4_Open ( void )
4074  {
4075  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 20))); /* 37 */
4076  ((int)(bitmapstruct.element1 |= (1 << 21))); /* 30 */
4077  UART_71zqendz ( 54 ) ; /* 30 */
4078  }
4079 
4081  DRV_TMR4_ClientStatus ( void ) ;
4082 
4083 static inline DRV_TMR_OPERATION_MODE
4085 {
4086  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 22))); /* 37 */
4087  ((int)(bitmapstruct.element1 |= (1 << 23))); /* 30 */
4088  UART_71zqendz ( 56 ) ; /* 30 */
4089  return
4091 }
4092 
4093 static inline void
4095  {
4096  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 24))); /* 37 */
4097  DRV_TMR4_Stop () ;
4098  ((int)(bitmapstruct.element1 |= (1 << 25))); /* 30 */
4099  UART_71zqendz ( 58 ) ; /* 30 */
4100  }
4101 
4102 bool
4104  DRV_TMR_CLK_SOURCES clockSource ,
4105  TMR_PRESCALE prescale ) ;
4106 
4107 void
4109  uint32_t value ) ;
4110 
4111 uint32_t
4112  DRV_TMR4_CounterValueGet ( void ) ;
4113 
4114 void
4115  DRV_TMR4_CounterClear ( void ) ;
4116 
4117 TMR_PRESCALE
4118  DRV_TMR4_PrescalerGet ( void ) ;
4119 
4120 void
4122  uint32_t value ) ;
4123 
4124 uint32_t
4125  DRV_TMR4_PeriodValueGet ( void ) ;
4126 
4127 void
4128  DRV_TMR4_StopInIdleDisable ( void ) ;
4129 
4130 void
4131  DRV_TMR4_StopInIdleEnable ( void ) ;
4132 
4133 static inline void
4135  {
4136  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 26))); /* 37 */
4137  ((int)(bitmapstruct.element1 |= (1 << 27))); /* 30 */
4138  UART_71zqendz ( 60 ) ; /* 30 */
4139  }
4140 
4141 uint32_t
4142  DRV_TMR4_CounterFrequencyGet ( void ) ;
4143 
4146  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4147  // #ifndef _DRV_TMR_STATIC_H
4148 /*******************************************************************************
4149  End of File
4150 */
4151 
4152 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h*/
4153 /* CLOSE_FILE Include File */
4154 
4155 #include "peripheral/int/plib_int.h"
4156 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h */
4157 /*******************************************************************************
4158  PMP Driver Interface Declarations for Static Single Instance Driver
4159  Company:
4160  Microchip Technology Inc.
4161  File Name:
4162  drv_pmp_static.h
4163  Summary:
4164  PMP driver interface declarations for the static single instance driver.
4165  Description:
4166  The PMP device driver provides a simple interface to manage the PMP
4167  modules on Microchip microcontrollers. This file defines the interface
4168  Declarations for the PMP driver.
4169 
4170  Remarks:
4171  Static interfaces incorporate the driver instance number within the names
4172  of the routines, eliminating the need for an object ID or object handle.
4173 
4174  Static single-open interfaces also eliminate the need for the open handle.
4175 *******************************************************************************/
4176 //DOM-IGNORE-BEGIN
4177 /*******************************************************************************
4178 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
4179 Microchip licenses to you the right to use, modify, copy and distribute
4180 Software only when embedded on a Microchip microcontroller or digital signal
4181 controller that is integrated into your product or third party product
4182 (pursuant to the sublicense terms in the accompanying license agreement).
4183 You should refer to the license agreement accompanying this Software for
4184 additional information regarding your rights and obligations.
4185 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4186 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4187 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4188 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4189 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4190 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4191 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4192 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4193 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4194 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4195 *******************************************************************************/
4196 //DOM-IGNORE-END
4197 #ifndef _DRV_PMP_STATIC_H
4198 #define _DRV_PMP_STATIC_H
4199 #include "peripheral/pmp/plib_pmp.h"
4200 // *****************************************************************************
4201 // *****************************************************************************
4202 // Section: Interface Headers for Instance 0 for the static driver
4203 // *****************************************************************************
4204 // *****************************************************************************
4205 
4206 void
4207  DRV_PMP0_Initialize ( void ) ;
4208 
4209 void
4210  DRV_PMP0_ModeConfig ( void ) ;
4211 
4212 void
4214  PMP_DATA_WAIT_STATES dataWait ,
4215  PMP_STROBE_WAIT_STATES strobeWait ,
4216  PMP_DATA_HOLD_STATES dataHold ) ;
4217 
4218 uint8_t
4219  DRV_PMP0_Read ( void ) ;
4220 
4221 void
4222  DRV_PMP0_Write (
4223  uint8_t data ) ;
4224  // #ifndef _DRV_PMP_STATIC_H
4225 /*******************************************************************************
4226  End of File
4227 */
4228 
4229 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h*/
4230 /* CLOSE_FILE Include File */
4231 
4232 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h */
4233 /*******************************************************************************
4234  USART Driver Interface Declarations for Static Single Instance Driver
4235  Company:
4236  Microchip Technology Inc.
4237  File Name:
4238  drv_usart_static.h
4239  Summary:
4240  USART driver interface declarations for the static single instance driver.
4241  Description:
4242  The USART device driver provides a simple interface to manage the USART
4243  modules on Microchip microcontrollers. This file defines the interface
4244  Declarations for the USART static driver.
4245  Remarks:
4246  Static interfaces incorporate the driver instance number within the names
4247  of the routines, eliminating the need for an object ID or object handle.
4248  Static single-open interfaces also eliminate the need for the open handle.
4249 *******************************************************************************/
4250 //DOM-IGNORE-BEGIN
4251 /*******************************************************************************
4252 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4253 Microchip licenses to you the right to use, modify, copy and distribute
4254 Software only when embedded on a Microchip microcontroller or digital signal
4255 controller that is integrated into your product or third party product
4256 (pursuant to the sublicense terms in the accompanying license agreement).
4257 You should refer to the license agreement accompanying this Software for
4258 additional information regarding your rights and obligations.
4259 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4260 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4261 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4262 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4263 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4264 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4265 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4266 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4267 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4268 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4269 *******************************************************************************/
4270 //DOM-IGNORE-END
4271 #ifndef _DRV_USART_STATIC_H
4272 #define _DRV_USART_STATIC_H
4273 // *****************************************************************************
4274 // *****************************************************************************
4275 // Section: Included Files
4276 // *****************************************************************************
4277 // *****************************************************************************
4278 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h */
4279 /*******************************************************************************
4280  USART Driver Local Data Structures for static implementation
4281  Company:
4282  Microchip Technology Inc.
4283  File Name:
4284  drv_usart_static_local.h
4285  Summary:
4286  USART Driver Local Data Structures for static implementation
4287  Description:
4288  Driver Local Data Structures for static implementation
4289 *******************************************************************************/
4290 //DOM-IGNORE-BEGIN
4291 /*******************************************************************************
4292 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4293 Microchip licenses to you the right to use, modify, copy and distribute Software
4294 only when embedded on a Microchip microcontroller or digital signal controller
4295 that is integrated into your product or third party product (pursuant to the
4296 sublicense terms in the accompanying license agreement).
4297 You should refer to the license agreement accompanying this Software for
4298 additional information regarding your rights and obligations.
4299 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4300 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4301 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4302 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4303 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4304 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4305 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4306 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4307 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4308 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4309 *******************************************************************************/
4310 //DOM-IGNORE-END
4311 #ifndef _DRV_USART_STATIC_LOCAL_H
4312 #define _DRV_USART_STATIC_LOCAL_H
4313 // *****************************************************************************
4314 // *****************************************************************************
4315 // Section: Included Files
4316 // *****************************************************************************
4317 // *****************************************************************************
4318 #include <stdint.h>
4319 #include <stdbool.h>
4320 #include <stddef.h>
4321 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h */
4322 /*******************************************************************************
4323  USART Driver Interface Header File
4324  Company:
4325  Microchip Technology Inc.
4326  File Name:
4327  drv_usart.h
4328  Summary:
4329  USART Driver Interface Header File
4330  Description:
4331  The USART device driver provides a simple interface to manage the USART or
4332  UART modules on Microchip microcontrollers. This file provides the
4333  interface definition for the USART driver.
4334 *******************************************************************************/
4335 //DOM-IGNORE-BEGIN
4336 /*******************************************************************************
4337 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4338 Microchip licenses to you the right to use, modify, copy and distribute
4339 Software only when embedded on a Microchip microcontroller or digital signal
4340 controller that is integrated into your product or third party product
4341 (pursuant to the sublicense terms in the accompanying license agreement).
4342 You should refer to the license agreement accompanying this Software for
4343 additional information regarding your rights and obligations.
4344 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4345 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4346 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4347 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4348 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4349 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4350 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4351 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4352 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4353 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4354 *******************************************************************************/
4355 //DOM-IGNORE-END
4356 #ifndef _DRV_USART_H
4357 #define _DRV_USART_H
4358 // *****************************************************************************
4359 // *****************************************************************************
4360 // Section: File includes
4361 // *****************************************************************************
4362 // *****************************************************************************
4363 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h */
4364 /*******************************************************************************
4365  USART Driver Definitions Header File
4366  Company:
4367  Microchip Technology Inc.
4368  File Name:
4369  drv_usart_definitions.h
4370  Summary:
4371  USART Driver Definitions Header File
4372  Description:
4373  This file will provide enumerations and other dependencies needed by
4374  USART driver to manage the USART/UART module on PIC32 microcontrollers.
4375 *******************************************************************************/
4376 //DOM-IGNORE-BEGIN
4377 /*******************************************************************************
4378 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4379 Microchip licenses to you the right to use, modify, copy and distribute
4380 Software only when embedded on a Microchip microcontroller or digital signal
4381 controller that is integrated into your product or third party product
4382 (pursuant to the sublicense terms in the accompanying license agreement).
4383 You should refer to the license agreement accompanying this Software for
4384 additional information regarding your rights and obligations.
4385 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4386 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4387 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4388 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4389 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4390 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4391 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4392 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4393 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4394 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4395 *******************************************************************************/
4396 //DOM-IGNORE-END
4397 #ifndef _DRV_USART_DEFINITIONS_H
4398 #define _DRV_USART_DEFINITIONS_H
4399 // *****************************************************************************
4400 // *****************************************************************************
4401 // Section: File includes
4402 // *****************************************************************************
4403 // *****************************************************************************
4404 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
4405 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
4406 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h */
4407 /*******************************************************************************
4408  USART Peripheral Library Interface Header
4409  Company:
4410  Microchip Technology Inc.
4411  File Name:
4412  plib_usart.h
4413  Summary:
4414  USART Peripheral Library interface header.
4415  Description:
4416  This header file contains the function prototypes and definitions of
4417  the data types and constants that make up the interface to the USART
4418  Peripheral Library for all families of Microchip microcontrollers. The
4419  functions in this file are common to the USART module.
4420  *******************************************************************************/
4421 // DOM-IGNORE-BEGIN
4422 /*******************************************************************************
4423 Copyright 2010-2015 released Microchip Technology Inc. All rights reserved.
4424 Microchip licenses to you the right to use, modify, copy and distribute
4425 Software only when embedded on a Microchip microcontroller or digital signal
4426 controller that is integrated into your product or third party product
4427 (pursuant to the sublicense terms in the accompanying license agreement).
4428 You should refer to the license agreement accompanying this Software for
4429 additional information regarding your rights and obligations.
4430 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4431 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4432 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4433 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4434 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4435 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4436 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4437 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4438 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4439 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4440  *******************************************************************************/
4441 // DOM-IGNORE-END
4442 #ifndef _PLIB_USART_H
4443 #define _PLIB_USART_H
4444 // DOM-IGNORE-BEGIN
4445 // DOM-IGNORE-END
4446 // ****************************************************************************
4447 // ****************************************************************************
4448 // Section: Included Files
4449 // ****************************************************************************
4450 // ****************************************************************************
4451 /* This section lists the other files that are included in this file.
4452 */
4453 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h */
4454 /*******************************************************************************
4455  Processor Selector File for the USART
4456  Company:
4457  Microchip Technology Incorporated
4458  File Name:
4459  processor.h
4460  Summary:
4461  Selects the appropriate header for the part family
4462  Description:
4463  This file selects the appropriate header for the part family
4464  *******************************************************************************/
4465 // DOM-IGNORE-BEGIN
4466 /*******************************************************************************
4467 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
4468 Microchip licenses to you the right to use, modify, copy and distribute
4469 Software only when embedded on a Microchip microcontroller or digital signal
4470 controller that is integrated into your product or third party product
4471 (pursuant to the sublicense terms in the accompanying license agreement).
4472 You should refer to the license agreement accompanying this Software for
4473 additional information regarding your rights and obligations.
4474 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4475 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4476 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4477 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4478 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4479 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4480 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4481 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4482 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4483 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4484  *******************************************************************************/
4485 // DOM-IGNORE-END
4486 #ifndef _USART_PROCESSOR_H
4487 #define _USART_PROCESSOR_H
4488 // *****************************************************************************
4489 // *****************************************************************************
4490 // Section: Included Files
4491 // *****************************************************************************
4492 // *****************************************************************************
4493 /* This section lists the other files that are included in this file.
4494  */
4495 #include <stdint.h>
4496 #include <stdbool.h>
4497 #error "No Processor Family specified"
4498  //
4499  // _USART_PROCESSOR_H
4500 /*******************************************************************************
4501  End of File
4502  */
4503 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h*/
4504 /* CLOSE_FILE Include File */
4505 
4506 // ****************************************************************************
4507 // ****************************************************************************
4508 // Section: USART Peripheral Library Interface Functions
4509 // ****************************************************************************
4510 // ****************************************************************************
4511 //******************************************************************************
4512 /* Function:
4513  void PLIB_USART_RunInOverflowEnable ( USART_MODULE_ID index )
4514  Summary:
4515  Enables the USART module to continue to operate when an overflow error
4516  condition has occurred.
4517  Description:
4518  This function enables the USART module to continue to operate when an
4519  overflow error condition has occurred.
4520  This operation is atomic.
4521  Precondition:
4522  None.
4523  Parameters:
4524  index - Identifier for the device instance to be configured
4525  Returns:
4526  None.
4527  Example:
4528  <code>
4529 #define MY_USART_INSTANCE USART_ID_1
4530  PLIB_USART_RunInOverflowEnable (MY_USART_INSTANCE);
4531  </code>
4532  Remarks:
4533  This feature may not be available on all devices. Please refer to the
4534  specific device data sheet to determine availability or use
4535  PLIB_USART_ExistsRunInOverflow in your application to determine
4536  whether this feature is available.
4537 */
4538 
4539 void
4541  USART_MODULE_ID index ) ;
4542 //******************************************************************************
4543 /* Function:
4544  void PLIB_USART_RunInOverflowDisable ( USART_MODULE_ID index )
4545  Summary:
4546  Disables the Run in overflow condition mode.
4547  Description:
4548  This function disables the USART module from accepting new data when an overflow
4549  error condition is detected.
4550  This operation is atomic.
4551  Precondition:
4552  None.
4553  Parameters:
4554  index - Identifier for the device instance to be configured
4555  Returns:
4556  None.
4557  Example:
4558  <code>
4559 #define MY_USART_INSTANCE USART_ID_1
4560  PLIB_USART_RunInOverflowDisable (MY_USART_INSTANCE);
4561  </code>
4562  Remarks:
4563  This feature may not be available on all devices. Please refer to the
4564  specific device data sheet to determine availability or use
4565  PLIB_USART_ExistsRunInOverflow in your application to determine
4566  whether this feature is available.
4567 */
4568 
4569 void
4571  USART_MODULE_ID index ) ;
4572 //******************************************************************************
4573 /* Function:
4574  bool PLIB_USART_RunInOverflowIsEnabled ( USART_MODULE_ID index )
4575  Summary:
4576  Gets the status of the Run in Overflow condition.
4577  Description:
4578  This function indicates if the USART module has been enabled to run in
4579  an overflow condition.
4580  This operation is atomic.
4581  Precondition:
4582  None.
4583  Parameters:
4584  index - Identifier for the device instance
4585  Returns:
4586  - true - Run in overflow condition is enabled
4587  - false - Run in overflow condition is disabled
4588  Example:
4589  <code>
4590 #define MY_USART_INSTANCE USART_ID_1
4591  bool status;
4592  status = PLIB_USART_RunInOverflowIsEnabled (MY_USART_INSTANCE);
4593  </code>
4594  Remarks:
4595  This feature may not be available on all devices. Please refer to the
4596  specific device data sheet to determine availability or use
4597  PLIB_USART_ExistsRunInOverflow in your application to determine
4598  whether this feature is available.
4599 */
4600 
4601 bool
4603  USART_MODULE_ID index ) ;
4604 //******************************************************************************
4605 /* Function:
4606  void PLIB_USART_BRGClockSourceSelect
4607  (
4608  USART_MODULE_ID index,
4609  USART_BRG_CLOCK_SOURCE brgClockSource
4610  )
4611  Summary:
4612  Configures the BRG clock source of the USART module.
4613  Description:
4614  This function configures the BRG Clock source of the USART. Refer to
4615  USART_BRG_CLOCK_SOURCE for the possible clock sources.
4616  Precondition:
4617  None.
4618  Parameters:
4619  index - Identifier for the device instance to be configured
4620  brgClockSource - One of the possible values from USART_BRG_CLOCK_SOURCE
4621  Returns:
4622  None.
4623  Example:
4624  <code>
4625 #define MY_USART_INSTANCE USART_ID_1
4626  PLIB_USART_BRGClockSourceSelect (MY_USART_INSTANCE, USART_BRG_CLOCK_SOURCE_FRC_IN_SLEEP);
4627  </code>
4628  Remarks:
4629  This feature may not be available on all devices. Please refer to the
4630  specific device data sheet to determine availability or use
4631  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
4632  whether this feature is available.
4633 */
4634 
4635 void
4637  USART_MODULE_ID index ,
4638  USART_BRG_CLOCK_SOURCE brgClockSource ) ;
4639 //******************************************************************************
4640 /* Function:
4641  USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet ( USART_MODULE_ID index )
4642  Summary:
4643  Gets the BRG clock source of the USART module.
4644  Description:
4645  This function returns the BRG Clock source of the USART. Refer to
4646  USART_BRG_CLOCK_SOURCE for the possible clock sources.
4647  This operation is atomic.
4648  Precondition:
4649  None.
4650  Parameters:
4651  index - Identifier for the device instance
4652  Returns:
4653  One of the possible values of USART_BRG_CLOCK_SOURCE
4654  Example:
4655  <code>
4656 #define MY_USART_INSTANCE USART_ID_1
4657  USART_BRG_CLOCK_SOURCE brgClockSource;
4658  brgClockSource = PLIB_USART_BRGClockSourceGet (MY_USART_INSTANCE);
4659  </code>
4660  Remarks:
4661  This feature may not be available on all devices. Please refer to the
4662  specific device data sheet to determine availability or use
4663  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
4664  whether this feature is available.
4665 */
4666 
4667 USART_BRG_CLOCK_SOURCE
4669  USART_MODULE_ID index ) ;
4670 //******************************************************************************
4671 /* Function:
4672  bool PLIB_USART_ModuleIsBusy ( USART_MODULE_ID index )
4673  Summary:
4674  Returns the USART module's running status.
4675  Description:
4676  This function checks if the USART module status is busy. The following
4677  functions should not be used when the module status is busy:
4678  - PLIB_USART_LineControlModeSelect
4679  - PLIB_USART_BaudRateHighSet
4680  - PLIB_USART_BaudRateHighEnable
4681  - PLIB_USART_BaudRateHighDisable
4682  - PLIB_USART_ReceiverIdleStateLowEnable
4683  - PLIB_USART_ReceiverIdleStateLowDisable
4684  - PLIB_USART_BaudRateAutoDetectEnable
4685  - PLIB_USART_LoopbackEnable
4686  - PLIB_USART_LoopbackDisable
4687  - PLIB_USART_WakeOnStartEnable
4688  - PLIB_USART_WakeOnStartDisable
4689  - PLIB_USART_OperationModeSelect
4690  - PLIB_USART_HandshakeModeSelect
4691  - PLIB_USART_IrDAEnable
4692  - PLIB_USART_IrDADisable
4693  - PLIB_USART_StopInIdleEnable
4694  - PLIB_USART_StopInIdleDisable
4695  - PLIB_USART_RunInOverflowEnable
4696  - PLIB_USART_RunInOverflowDisable
4697  - PLIB_USART_BRGClockSourceSelect
4698  - PLIB_USART_RunInSleepModeEnable
4699  - PLIB_USART_RunInSleepModeDisable
4700  This operation is atomic.
4701  Precondition:
4702  None.
4703  Parameters:
4704  index - Identifier for the device instance
4705  Returns:
4706  - true - USART module is busy
4707  - false - USART module is idle
4708  Example:
4709  <code>
4710 #define MY_USART_INSTANCE USART_ID_1
4711  bool moduleStatus;
4712  moduleStatus = PLIB_USART_ModuleIsBusy (MY_USART_INSTANCE);
4713  </code>
4714  Remarks:
4715  This feature may not be available on all devices. Please refer to the
4716  specific device data sheet to determine availability or use
4717  PLIB_USART_ExistsModuleBusyStatus in your application to determine
4718  whether this feature is available.
4719 */
4720 
4721 bool
4723  USART_MODULE_ID index ) ;
4724 //******************************************************************************
4725 /* Function:
4726  void PLIB_USART_RunInSleepModeEnable ( USART_MODULE_ID index )
4727  Summary:
4728  Allows the USART module's BRG clock to run when the device enters Sleep mode.
4729  Description:
4730  This function enables the USART module's BRG clock to continue operation when
4731  the device enters the Sleep mode.
4732  This operation is atomic.
4733  Precondition:
4734  None.
4735  Parameters:
4736  index - Identifier for the device instance to be configured
4737  Returns:
4738  None.
4739  Example:
4740  <code>
4741 #define MY_USART_INSTANCE USART_ID_1
4742  PLIB_USART_RunInSleepModeEnable (MY_USART_INSTANCE);
4743  </code>
4744  Remarks:
4745  This feature may not be available on all devices. Please refer to the
4746  specific device data sheet to determine availability or use
4747  PLIB_USART_ExistsRunInSleepMode in your application to determine
4748  whether this feature is available.
4749 */
4750 
4751 void
4753  USART_MODULE_ID index ) ;
4754 //******************************************************************************
4755 /* Function:
4756  void PLIB_USART_RunInSleepModeDisable ( USART_MODULE_ID index )
4757  Summary:
4758  Turns off the USART module's BRG clock during Sleep mode.
4759  Description:
4760  This function turns off the USART module's BRG clock during Sleep mode.
4761  This operation is atomic.
4762  Precondition:
4763  None.
4764  Parameters:
4765  index - Identifier for the device instance to be configured
4766  Returns:
4767  None.
4768  Example:
4769  <code>
4770 #define MY_USART_INSTANCE USART_ID_1
4771  PLIB_USART_RunInSleepModeDisable (MY_USART_INSTANCE);
4772  </code>
4773  Remarks:
4774  This feature may not be available on all devices. Please refer to the
4775  specific device data sheet to determine availability or use
4776  PLIB_USART_ExistsRunInSleepMode in your application to determine
4777  whether this feature is available.
4778 */
4779 
4780 void
4782  USART_MODULE_ID index ) ;
4783 //******************************************************************************
4784 /* Function:
4785  bool PLIB_USART_RunInSleepModeIsEnabled ( USART_MODULE_ID index )
4786  Summary:
4787  Gets the status of Run in Sleep mode.
4788  Description:
4789  This function indicates if the USART module has been enabled to run in
4790  Sleep mode.
4791  This operation is atomic.
4792  Precondition:
4793  None.
4794  Parameters:
4795  index - Identifier for the device instance
4796  Returns:
4797  - true - Run in Sleep mode is enabled
4798  - false - Run in Sleep mode is disabled
4799  Example:
4800  <code>
4801 #define MY_USART_INSTANCE USART_ID_1
4802  bool status;
4803  status = PLIB_USART_RunInSleepModeIsEnabled (MY_USART_INSTANCE);
4804  </code>
4805  Remarks:
4806  This feature may not be available on all devices. Please refer to the
4807  specific device data sheet to determine availability or use
4808  PLIB_USART_ExistsRunInSleepMode in your application to determine
4809  whether this feature is available.
4810 */
4811 
4812 bool
4814  USART_MODULE_ID index ) ;
4815 //******************************************************************************
4816 /* Function:
4817  void PLIB_USART_Enable ( USART_MODULE_ID index )
4818  Summary:
4819  Enables the specific USART module.
4820  Description:
4821  This function enables the specific USART module.
4822  This operation is atomic.
4823  Precondition:
4824  None.
4825  Parameters:
4826  index - Identifier for the device instance to be configured
4827  Returns:
4828  None.
4829  Example:
4830  <code>
4831 #define MY_USART_INSTANCE USART_ID_1
4832  PLIB_USART_Enable(MY_USART_INSTANCE);
4833  </code>
4834  Remarks:
4835  By calling this function, the USART pins are controlled by the USART
4836  module.
4837  This feature may not be available on all devices. Please refer to the
4838  specific device data sheet to determine availability or use
4839  PLIB_USART_ExistsEnable in your application to determine whether
4840  this feature is available.
4841 */
4842 
4843 void
4845  USART_MODULE_ID index ) ;
4846 //******************************************************************************
4847 /* Function:
4848  void PLIB_USART_Disable ( USART_MODULE_ID index )
4849  Summary:
4850  Disables the specific USART module
4851  Description:
4852  This function disables the specific USART module.
4853  This operation is atomic.
4854  Precondition:
4855  None.
4856  Parameters:
4857  index - Identifier for the device instance to be configured
4858  Returns:
4859  None.
4860  Example:
4861  <code>
4862 #define MY_USART_INSTANCE USART_ID_1
4863  PLIB_USART_Disable(MY_USART_INSTANCE);
4864  </code>
4865  Remarks:
4866  The default state after any reset for a USART module is the disable state.
4867  If the USART is disabled, all of the related pins are in control of the
4868  general purpose I/O logic.
4869 
4870  Disabling the USART module resets the buffers to empty states. Any data
4871  characters in the buffers are lost and the baud rate is reset. All error
4872  and status bits are also reset.
4873 
4874  Disabling the USART while the USART is active, will abort all pending
4875  transmissions and receptions. Re-enabling the USART will restart the
4876  module in the same configuration.
4877 
4878  When disabled, the USART power consumption is minimal.
4879  This feature may not be available on all devices. Please refer to the
4880  specific device data sheet to determine availability or use
4881  PLIB_USART_ExistsEnable in your application to determine whether
4882  this feature is available.
4883 */
4884 
4885 void
4887  USART_MODULE_ID index ) ;
4888 //******************************************************************************
4889 /* Function:
4890  void PLIB_USART_TransmitterEnable ( USART_MODULE_ID index )
4891  Summary:
4892  Enables the specific USART module transmitter.
4893  Description:
4894  This function enables the specific USART module transmitter.
4895  This operation is atomic.
4896  Precondition:
4897  The USART module should be enabled using the function PLIB_USART_Enable
4898  before this function is called.
4899  Parameters:
4900  index - Identifier for the device instance to be configured
4901  Returns:
4902  None.
4903  Example:
4904  <code>
4905 #define MY_USART_INSTANCE USART_ID_1
4906  PLIB_USART_TransmitterEnable(MY_USART_INSTANCE);
4907  </code>
4908  Remarks:
4909  The transmitter should not be enabled until the USART is enabled.
4910  The transmissions will not be enabled otherwise.
4911 
4912  This feature may not be available on all devices. Please refer to the
4913  specific device data sheet to determine availability or use
4914  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
4915  this feature is available.
4916 */
4917 
4918 void
4920  USART_MODULE_ID index ) ;
4921 //******************************************************************************
4922 /* Function:
4923  void PLIB_USART_TransmitterDisable ( USART_MODULE_ID index )
4924  Summary:
4925  Disables the specific USART module transmitter.
4926  Description:
4927  This function disables the specific USART module transmitter.
4928  This operation is atomic.
4929  Precondition:
4930  None.
4931  Parameters:
4932  index - Identifier for the device instance to be configured
4933  Returns:
4934  None.
4935  Example:
4936  <code>
4937 #define MY_USART_INSTANCE USART_ID_1
4938  PLIB_USART_TransmitterDisable(MY_USART_INSTANCE);
4939  </code>
4940  Remarks:
4941  Disabling the transmitter during a transmission will cause the
4942  transmission to be aborted.
4943 
4944  This feature may not be available on all devices. Please refer to the
4945  specific device data sheet to determine availability or use
4946  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
4947  this feature is available.
4948 */
4949 
4950 void
4952  USART_MODULE_ID index ) ;
4953 //******************************************************************************
4954 /* Function:
4955  void PLIB_USART_BaudRateSet ( USART_MODULE_ID index, uint32_t clockFrequency,
4956  uint32_t baudRate );
4957  Summary:
4958  Sets the baud rate to the desired value.
4959  Description:
4960  This function sets the baud rate to the desired value.
4961  Precondition:
4962  None.
4963  Parameters:
4964  index - Identifier for the device instance to be configured
4965  baudRate - Baud Rate Value
4966  clockFrequency - Clock Frequency
4967  Returns:
4968  None.
4969  Example:
4970  <code>
4971 #define MY_USART_INSTANCE USART_ID_1
4972  uint32_t baudRateValue ;
4973  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
4974  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
4975  </code>
4976  Remarks:
4977  Setting a new baud rate value causes the baud rate timer to reset.
4978  This ensures that the baud rate timer does not have to overflow before
4979  outputting the new baud rate.
4980 
4981  If the system clock is changed during an active receive operation, a
4982  receiver error or data loss may result. To avoid this issue verify that
4983  no receptions are in progress before changing the system clock.
4984 
4985  This feature may not be available on all devices. Please refer to the
4986  specific device data sheet to determine availability or use
4987  PLIB_USART_ExistsBaudRate in your application to determine whether
4988  this feature is available.
4989 */
4990 
4991 void
4993  USART_MODULE_ID index ,
4994  uint32_t clockFrequency ,
4995  uint32_t baudRate ) ;
4996 //******************************************************************************
4997 /* Function:
4998  void PLIB_USART_BaudRateHighSet ( USART_MODULE_ID index,
4999  uint32_t clockFrequency, uint32_t baudRate );
5000  Summary:
5001  Sets the baud rate to the desired value.
5002  Description:
5003  This function sets the baud rate to the desired value.
5004  Precondition:
5005  None.
5006  Parameters:
5007  index - Identifier for the device instance to be configured
5008  baudRate - Baud Rate Value, it is the baud rate value
5009  clockFrequency - Clock Frequency
5010  Returns:
5011  None.
5012  Example:
5013  <code>
5014 #define MY_USART_INSTANCE USART_ID_1
5015  uint32_t baudRateValue ;
5016  PLIB_USART_BaudRateHighSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5017  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5018  </code>
5019  Remarks:
5020  Setting a new baud rate value causes the baud rate timer to reset.
5021  This ensures that the baud rate timer does not have to overflow before
5022  outputting the new baud rate.
5023 
5024  If the system clock is changed during an active receive operation, a
5025  receiver error or data loss may result. To avoid this issue verify that
5026  no receptions are in progress before changing the system clock.
5027 
5028  This feature may not be available on all devices. Please refer to the
5029  specific device data sheet to determine availability or use
5030  PLIB_USART_ExistsBaudRateHigh in your application to determine whether
5031  this feature is available.
5032 */
5033 
5034 void
5036  USART_MODULE_ID index ,
5037  uint32_t clockFrequency ,
5038  uint32_t baudRate ) ;
5039 //******************************************************************************
5040 /* Function:
5041  uint32_t PLIB_USART_BaudRateGet ( USART_MODULE_ID index,
5042  int32_t clockFrequency );
5043  Summary:
5044  Gets the baud rate current in use.
5045  Description:
5046  This function gets the baud rate that is currently in use. The clock frequency
5047  needs to be passed to the function.
5048  Conditions:
5049  None.
5050  Input:
5051  index - Identifier for the device instance to be configured
5052  clockFrequency - Clock Frequency
5053  Returns:
5054  - BaudRate - Baud rate value
5055  Example:
5056  <code>
5057 #define MY_USART_INSTANCE USART_ID_1
5058  uint32_t baudRate ;
5059  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5060  baudRate = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5061  </code>
5062  Remarks:
5063  This feature may not be available on all devices. Please refer to the
5064  specific device data sheet to determine availability or use
5065  PLIB_USART_ExistsBaudRate in your application to determine whether
5066  this feature is available.
5067 */
5068 
5069 uint32_t
5071  USART_MODULE_ID index ,
5072  int32_t clockFrequency ) ;
5073 //******************************************************************************
5074 /* Function:
5075  void PLIB_USART_AddressSet
5076  (
5077  USART_MODULE_ID index,
5078  uint8_t address
5079  )
5080  Summary:
5081  Sets the address for the Address Detect mode.
5082  Description:
5083  This function sets the address for the Address Detect mode.
5084  This operation is atomic.
5085  Precondition:
5086  None.
5087  Parameters:
5088  index - Identifier for the device instance to be configured
5089  address - Address
5090  Returns:
5091  None.
5092  Example:
5093  <code>
5094 #define MY_USART_INSTANCE USART_ID_1
5095  uint8_t address = 0x02;
5096  PLIB_USART_AddressSet (MY_USART_INSTANCE, address);
5097  </code>
5098  Remarks:
5099  This feature may not be available on all devices. Please refer to the
5100  specific device data sheet to determine availability or use
5101  PLIB_USART_ExistsReceiverAddress in your application to determine
5102  whether this feature is available.
5103 */
5104 
5105 void
5107  USART_MODULE_ID index ,
5108  uint8_t address ) ;
5109 //******************************************************************************
5110 /* Function:
5111  uint8_t PLIB_USART_AddressGet
5112  (
5113  USART_MODULE_ID index
5114  )
5115  Summary:
5116  Gets the address for the Address Detect mode.
5117  Description:
5118  This function returns the address value being used for the Address
5119  Detect mode.
5120  This operation is atomic.
5121  Precondition:
5122  None.
5123  Parameters:
5124  index - Identifier for the device instance
5125  Returns:
5126  - address - The address being used
5127  Example:
5128  <code>
5129 #define MY_USART_INSTANCE USART_ID_1
5130  uint8_t address = 0;
5131  address = PLIB_USART_AddressGet (MY_USART_INSTANCE);
5132  </code>
5133  Remarks:
5134  This feature may not be available on all devices. Please refer to the
5135  specific device data sheet to determine availability or use
5136  PLIB_USART_ExistsReceiverAddress in your application to determine
5137  whether this feature is available.
5138 */
5139 
5140 uint8_t
5142  USART_MODULE_ID index ) ;
5143 //******************************************************************************
5144 /* Function:
5145  void PLIB_USART_AddressMaskSet
5146  (
5147  USART_MODULE_ID index,
5148  uint8_t mask
5149  )
5150  Summary:
5151  Sets the address mask for the Address Detect mode.
5152  Description:
5153  This function sets the address mask for the Address Detect mode.
5154  This operation is atomic.
5155  Precondition:
5156  None.
5157  Parameters:
5158  index - Identifier for the device instance to be configured
5159  mask - Address match mask bits
5160  Returns:
5161  None.
5162  Example:
5163  <code>
5164 #define MY_USART_INSTANCE USART_ID_1
5165  uint8_t mask = 0x0F;
5166  PLIB_USART_AddressMaskSet (MY_USART_INSTANCE, mask);
5167  </code>
5168  Remarks:
5169  This feature may not be available on all devices. Please refer to the
5170  specific device data sheet to determine availability or use
5171  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5172  whether this feature is available.
5173 */
5174 
5175 void
5177  USART_MODULE_ID index ,
5178  uint8_t mask ) ;
5179 //******************************************************************************
5180 /* Function:
5181  uint8_t PLIB_USART_AddressMaskGet
5182  (
5183  USART_MODULE_ID index
5184  )
5185  Summary:
5186  Gets the address mask for the Address Detect mode.
5187  Description:
5188  This function returns the address mask value being used for the Address
5189  Detect mode.
5190  This operation is atomic.
5191  Precondition:
5192  None.
5193  Parameters:
5194  index - Identifier for the device instance to be configured
5195  Returns:
5196  - mask - Address mask being used
5197  Example:
5198  <code>
5199 #define MY_USART_INSTANCE USART_ID_1
5200  uint8_t mask = 0;
5201  mask = PLIB_USART_AddressMaskGet (MY_USART_INSTANCE);
5202  </code>
5203  Remarks:
5204  This feature may not be available on all devices. Please refer to the
5205  specific device data sheet to determine availability or use
5206  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5207  whether this feature is available.
5208 */
5209 
5210 uint8_t
5212  USART_MODULE_ID index ) ;
5213 //******************************************************************************
5214 /* Function:
5215  void PLIB_USART_ReceiverAddressDetectEnable ( USART_MODULE_ID index )
5216  Summary:
5217  Enables the Address Detect mode.
5218  Description:
5219  This function enables the Address Detect mode. If it is enabled, and the
5220  device is addressed, disable the Address Detect mode to continue receiving
5221  bytes.
5222  This operation is atomic.
5223  Precondition:
5224  None.
5225  Parameters:
5226  index - Identifier for the device instance to be configured
5227  Returns:
5228  None.
5229  Example:
5230  <code>
5231 #define MY_USART_INSTANCE USART_ID_1
5232  PLIB_USART_ReceiverAddressDetectEnable(MY_USART_INSTANCE);
5233  </code>
5234  Remarks:
5235  If 9 data bits are not selected, this bit has no effect.
5236  This feature may not be available on all devices. Please refer to the
5237  specific device data sheet to determine availability or use
5238  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5239  this feature is available.
5240 */
5241 
5242 void
5244  USART_MODULE_ID index ) ;
5245 //******************************************************************************
5246 /* Function:
5247  void PLIB_USART_ReceiverAddressDetectDisable ( USART_MODULE_ID index )
5248  Summary:
5249  Enables the Address Detect mode.
5250  Description:
5251  This function disables the Address Detect mode. If it is enabled, and the
5252  device is addressed, disable the Address Detect mode to continue receiving
5253  bytes.
5254  This operation is atomic.
5255  Precondition:
5256  None.
5257  Parameters:
5258  index - Identifier for the device instance to be configured
5259  Returns:
5260  None.
5261  Example:
5262  <code>
5263 #define MY_USART_INSTANCE USART_ID_1
5264  PLIB_USART_ReceiverAddressDetectDisable(MY_USART_INSTANCE);
5265  </code>
5266  Remarks:
5267  All bytes are received, and the 9th bit can be used as the parity bit.
5268  By default, the address detect is disabled.
5269 
5270  This feature may not be available on all devices. Please refer to the
5271  specific device data sheet to determine availability or use
5272  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5273  this feature is available.
5274 */
5275 
5276 void
5278  USART_MODULE_ID index ) ;
5279 //******************************************************************************
5280 /* Function:
5281  bool PLIB_USART_BaudRateAutoDetectIsComplete ( USART_MODULE_ID index )
5282  Summary:
5283  Gets the state of the automatic baud detection.
5284  Description:
5285  This function gets the state of the automatic baud detection and returns a '0'
5286  if the baud rate auto detection is complete.
5287  This operation is atomic.
5288  Precondition:
5289  None.
5290  Parameters:
5291  index - Identifier for the device instance to be configured
5292  Returns:
5293  - true - Baud rate detection is not complete
5294  - false - Baud rate detection is complete
5295  Example:
5296  <code>
5297 #define MY_USART_INSTANCE USART_ID_1
5298  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5299  // Wait until the baud rate is detected.
5300  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5301  </code>
5302  Remarks:
5303  This feature may not be available on all devices. Please refer to the
5304  specific device data sheet to determine availability or use
5305  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5306  this feature is available.
5307 */
5308 
5309 bool
5311  USART_MODULE_ID index ) ;
5312 //******************************************************************************
5313 /* Function:
5314  void PLIB_USART_BaudRateAutoDetectEnable ( USART_MODULE_ID index )
5315  Summary:
5316  Enables baud rate measurement on the next character, which requires reception
5317  of the Sync character.
5318  Description:
5319  This function enables the baud rate measurement on the next character,
5320  which requires reception of the Sync character.
5321  This operation is atomic.
5322  Precondition:
5323  None.
5324  Parameters:
5325  index - Identifier for the device instance to be configured
5326  Returns:
5327  None.
5328  Example:
5329  <code>
5330 #define MY_USART_INSTANCE USART_ID_1
5331  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5332  // Wait until the baud rate is detected.
5333  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5334  </code>
5335  Remarks:
5336  This feature may not be available on all devices. Please refer to the
5337  specific device data sheet to determine availability or use
5338  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5339  this feature is available.
5340 */
5341 
5342 void
5344  USART_MODULE_ID index ) ;
5345 //******************************************************************************
5346 /* Function:
5347  void PLIB_USART_TransmitterByteSend ( USART_MODULE_ID index, int8_t data )
5348  Summary:
5349  Data to be transmitted in the Byte mode.
5350  Description:
5351  The data is transmitted in the Byte mode for the specified USART module.
5352  This operation is atomic.
5353  Precondition:
5354  None.
5355  Parameters:
5356  index - Identifier for the device instance to be configured
5357  data - Data to be transmitted.
5358  Returns:
5359  None.
5360  Example:
5361  <code>
5362 #define MY_USART_INSTANCE USART_ID_1
5363  uint8_t data = 'a';
5364  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5365  {
5366  PLIB_USART_TransmitterByteSend(MY_USART_INSTANCE, data);
5367  }
5368  </code>
5369  Remarks:
5370  This feature may not be available on all devices. Please refer to the
5371  specific device data sheet to determine availability or use
5372  PLIB_USART_ExistsTransmitter in your application to determine whether
5373  this feature is available.
5374 */
5375 
5376 void
5378  USART_MODULE_ID index ,
5379  int8_t data ) ;
5380 //******************************************************************************
5381 /* Function:
5382  int8_t PLIB_USART_ReceiverByteReceive ( USART_MODULE_ID index )
5383  Summary:
5384  Data to be received in the Byte mode.
5385  Description:
5386  The data to be received in Byte mode from the specified USART module.
5387  This operation is atomic.
5388  Call the functions PLIB_USART_ReceiverFramingErrorHasOccurred,
5389  PLIB_USART_ReceiverParityErrorHasOccurred and
5390  PLIB_USART_ReceiverOverrunHasOccurred to get any error that occurred.
5391  Precondition:
5392  None.
5393  Parameters:
5394  index - Identifier for the device instance to be configured
5395  Returns:
5396  - data - Data to be received
5397  Example:
5398  <code>
5399 #define MY_USART_INSTANCE USART_ID_1
5400  bool isError;
5401  uint8_t mydata;
5402  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5403  {
5404  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5405  }
5406  isError = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE) |
5407  PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE) |
5408  PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE);
5409  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5410  {
5411  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5412  }
5413  </code>
5414  Remarks:
5415  This feature may not be available on all devices. Please refer to the
5416  specific device data sheet to determine availability or use
5417  PLIB_USART_ExistsReceiver in your application to determine whether
5418  this feature is available.
5419 */
5420 
5421 int8_t
5423  USART_MODULE_ID index ) ;
5424 //******************************************************************************
5425 /* Function:
5426  int16_t PLIB_USART_Receiver9BitsReceive ( USART_MODULE_ID index )
5427  Summary:
5428  Data to be received in the byte mode with the 9th bit.
5429  Description:
5430  The data to be received in Byte mode from the specified USART module.
5431  with the 9th bit.
5432  This operation is atomic.
5433  Precondition:
5434  None.
5435  Parameters:
5436  index - Identifier for the device instance to be configured
5437  Returns:
5438  - data - Data to be received
5439  Example:
5440  <code>
5441 #define MY_USART_INSTANCE USART_ID_1
5442  uint16_t mydata;
5443  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5444  {
5445  mydata = PLIB_USART_Receiver9BitsReceive (MY_USART_INSTANCE);
5446  }
5447  </code>
5448  Remarks:
5449  This feature may not be available on all devices. Please refer to the
5450  specific device data sheet to determine availability or use
5451  PLIB_USART_ExistsReceiver9Bits in your application to determine
5452  whether this feature is available.
5453 */
5454 
5455 int16_t
5457  USART_MODULE_ID index ) ;
5458 //******************************************************************************
5459 /* Function:
5460  bool PLIB_USART_ReceiverAddressIsReceived ( USART_MODULE_ID index )
5461  Summary:
5462  Checks and return if the data received is an address.
5463  Description:
5464  Checks and return if the data received is an address. The address has
5465  the 9th bit set. If data received has the 9th bit set, the function returns true;
5466  otherwise, the function returns false.
5467  This operation is atomic.
5468  Precondition:
5469  The USART module should be configured to use the 9 data bits.
5470  Parameters:
5471  index - Identifier for the device instance to be configured
5472  Returns:
5473  - true - if the data received has the 9th bit set
5474  - false - if the address received has the 9th bit cleared
5475  Example:
5476  <code>
5477 #define MY_USART_INSTANCE USART_ID_1
5478  int8_t address;
5479  if(PLIB_USART_ReceiverAddressIsReceived(MY_USART_INSTANCE))
5480  {
5481  address = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5482  }
5483  </code>
5484  Remarks:
5485  This feature may not be available on all devices. Please refer to the
5486  specific device data sheet to determine availability or use
5487  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5488  this feature is available.
5489 */
5490 
5491 bool
5493  USART_MODULE_ID index ) ;
5494 //******************************************************************************
5495 /* Function:
5496  void PLIB_USART_Transmitter9BitsSend ( USART_MODULE_ID index,
5497  int8_t data, bool 9thBit )
5498  Summary:
5499  Data to be transmitted in the byte mode with the 9th bit.
5500  Description:
5501  The data is transmitted in the byte mode for the specified USART module,
5502  with 9th bit.
5503  This operation is atomic.
5504  Precondition:
5505  The USART module should be configured to use the 9 data bits.
5506  Parameters:
5507  index - Identifier for the device instance to be configured
5508  data - Data to be transmitted.
5509  9thBit - 9th bit of the data to be transmitted.
5510  Returns:
5511  None.
5512  Example:
5513  <code>
5514 #define MY_USART_INSTANCE USART_ID_1
5515  uint8_t data = 'a';
5516  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5517  {
5518  PLIB_USART_Transmitter9BitsSend(MY_USART_INSTANCE, data, false);
5519  }
5520  </code>
5521  Remarks:
5522  This feature may not be available on all devices. Please refer to the
5523  specific device data sheet to determine availability or use
5524  PLIB_USART_ExistsTransmitter9BitsSend in your application to determine whether
5525  this feature is available.
5526 */
5527 
5528 void
5530  USART_MODULE_ID index ,
5531  int8_t data ,
5532  bool Bit9th ) ;
5533 //******************************************************************************
5534 /* Function:
5535  void PLIB_USART_TransmitterBreakSend ( USART_MODULE_ID index )
5536  Summary:
5537  Transmits the break character.
5538  Description:
5539  This function transmits the break character.
5540  This operation is atomic.
5541  Precondition:
5542  The application should wait for the transmitter to be idle, before calling
5543  this function.
5544  Parameters:
5545  index - Identifier for the device instance to be configured
5546  Returns:
5547  None.
5548  Example:
5549  <code>
5550 #define MY_USART_INSTANCE USART_ID_1
5551  // Wait for the Transmit buffer to be empty.
5552  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5553  // Transmit the break character.
5554  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5555  // wait for the break transmission to complete
5556  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
5557  </code>
5558  Remarks:
5559  After the break has been transmitted, the application can start
5560  transmitting next bytes.
5561 
5562  This feature may not be available on all devices. Please refer to the
5563  specific device data sheet to determine availability or use
5564  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
5565  this feature is available.
5566 */
5567 
5568 void
5570  USART_MODULE_ID index ) ;
5571 //******************************************************************************
5572 /* Function:
5573  bool PLIB_USART_TransmitterBreakSendIsComplete ( USART_MODULE_ID index )
5574  Summary:
5575  Returns the status of the break transmission
5576  Description:
5577  The function returns the status of the break transmission.
5578  This operation is atomic.
5579  Precondition:
5580  None.
5581  Parameters:
5582  index - Identifier for the device instance to be configured
5583  Returns:
5584  - true - Transmit break on the next transmission
5585  - false - Break transmission completed or not started
5586  Example:
5587  <code>
5588 #define MY_USART_INSTANCE USART_ID_1
5589  // Wait for the Transmit buffer to be empty.
5590  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5591  // Transmit the break character.
5592  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5593  // wait for the break transmission to complete
5594  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
5595  </code>
5596  Remarks:
5597  After the break has been transmitted, the application can start
5598  transmitting next bytes.
5599 
5600  This feature may not be available on all devices. Please refer to the
5601  specific device data sheet to determine availability or use
5602  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
5603  this feature is available.
5604 */
5605 
5606 bool
5608  USART_MODULE_ID index ) ;
5609 //******************************************************************************
5610 /* Function:
5611  bool PLIB_USART_ReceiverDataIsAvailable ( USART_MODULE_ID index )
5612  Summary:
5613  Identifies if the receive data is available for the specified USART module.
5614  Description:
5615  This function identifies if the receive data is available for the specified
5616  USART module.
5617  This operation is atomic.
5618  Precondition:
5619  None.
5620  Parameters:
5621  index - Identifier for the device instance to be configured
5622  Returns:
5623  - true - The data is available
5624  - false - The data is not available
5625  Example:
5626  <code>
5627 #define MY_USART_INSTANCE USART_ID_1
5628  int8_t mydata;
5629  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5630  {
5631  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5632  }
5633  </code>
5634  Remarks:
5635  This feature may not be available on all devices. Please refer to the
5636  specific device data sheet to determine availability or use
5637  PLIB_USART_ExistsReceiverDataAvailableStatus in your application to determine
5638  whether this feature is available.
5639 */
5640 
5641 bool
5643  USART_MODULE_ID index ) ;
5644 //******************************************************************************
5645 /* Function:
5646  void PLIB_USART_ReceiverOverrunErrorClear ( USART_MODULE_ID index )
5647  Summary:
5648  Clears a USART vverrun error.
5649  Description:
5650  This function clears an overrun error. Clearing the error, resets the receive buffer.
5651  This operation is atomic.
5652  Precondition:
5653  None.
5654  Parameters:
5655  index - Identifier for the device instance to be configured
5656  Returns:
5657  None.
5658  Example:
5659  <code>
5660 #define MY_USART_INSTANCE USART_ID_1
5661  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5662  {
5663  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5664  }
5665  </code>
5666  Remarks:
5667  WARNING: Calling this API will clear all of the previously received data.
5668 
5669  This feature may not be available on all devices. Please refer to the
5670  specific device data sheet to determine availability or use
5671  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
5672  whether this feature is available.
5673 */
5674 
5675 void
5677  USART_MODULE_ID index ) ;
5678 //******************************************************************************
5679 /* Function:
5680  bool PLIB_USART_TransmitterBufferIsFull ( USART_MODULE_ID index )
5681  Summary:
5682  Gets the transmit buffer full status.
5683  Description:
5684  This function gets the transmit status of the specified USART module.
5685  This operation is atomic.
5686  Precondition:
5687  None.
5688  Parameters:
5689  index - Identifier for the device instance to be configured
5690  Returns:
5691  - true - The transmit buffer is full
5692  - false - The transmit buffer is not full, at least one more
5693  character can be written
5694  Example:
5695  <code>
5696 #define MY_USART_INSTANCE USART_ID_1
5697  // Wait for the Transmit buffer to be empty.
5698  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5699  // Transmit the break character.
5700  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5701  </code>
5702  Remarks:
5703  This feature may not be available on all devices. Please refer to the
5704  specific device data sheet to determine availability or use
5705  PLIB_USART_ExistsTransmitterBufferFullStatus in your application to determine
5706  whether this feature is available.
5707 */
5708 
5709 bool
5711  USART_MODULE_ID index ) ;
5712 //******************************************************************************
5713 /* Function:
5714  bool PLIB_USART_TransmitterIsEmpty ( USART_MODULE_ID index )
5715  Summary:
5716  Gets the transmit shift register empty status.
5717  Description:
5718  This function gets the transmit shift register empty status.
5719  This operation is atomic.
5720  Precondition:
5721  None.
5722  Parameters:
5723  index - Identifier for the device instance to be configured
5724  Returns:
5725  - true - The transmit shift register is empty
5726  - false - The transmit shift register is not empty
5727  Example:
5728  <code>
5729 #define MY_USART_INSTANCE USART_ID_1
5730  // Wait for the Transmit buffer to be empty.
5731  while(!PLIB_USART_TransmitterIsEmpty(MY_USART_INSTANCE));
5732  // Transmit the break character.
5733  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5734  </code>
5735  Remarks:
5736  This feature may not be available on all devices. Please refer to the
5737  specific device data sheet to determine availability or use
5738  PLIB_USART_ExistsTransmitterEmptyStatus in your application to determine
5739  whether this feature is available.
5740 */
5741 
5742 bool
5744  USART_MODULE_ID index ) ;
5745 //******************************************************************************
5746 /* Function:
5747  bool PLIB_USART_ReceiverFramingErrorHasOccurred ( USART_MODULE_ID index )
5748  Summary:
5749  Gets the framing error status.
5750  Description:
5751  This function gets the framing error status.
5752  This operation is atomic.
5753  Precondition:
5754  None.
5755  Parameters:
5756  index - Identifier for the device instance to be configured
5757  Returns:
5758  - true - The framing error was detected on the current character
5759  - false - The framing error was not detected on the current
5760  character
5761  Example:
5762  <code>
5763 #define MY_USART_INSTANCE USART_ID_1
5764  status = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE);
5765  </code>
5766  Remarks:
5767  Reading the error clears the error.
5768  This feature may not be available on all devices. Please refer to the
5769  specific device data sheet to determine availability or use
5770  PLIB_USART_ExistsReceiverFramingErrorStatus in your application to determine
5771  whether this feature is available.
5772 */
5773 
5774 bool
5776  USART_MODULE_ID index ) ;
5777 //******************************************************************************
5778 /* Function:
5779  bool PLIB_USART_ReceiverParityErrorHasOccurred ( USART_MODULE_ID index )
5780  Summary:
5781  Gets the parity error status.
5782  Description:
5783  This function gets the parity error status.
5784  This operation is atomic.
5785  Precondition:
5786  None.
5787  Parameters:
5788  index - Identifier for the device instance to be configured
5789  Returns:
5790  - true - The parity error was detected on the current character
5791  - false - The parity error was not detected on the current character
5792  Example:
5793  <code>
5794 #define MY_USART_INSTANCE USART_ID_1
5795  status = PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE);
5796  </code>
5797  Remarks:
5798  Reading the error clears the error.
5799  A Parity error is irrelevant in case of 9-bit mode.
5800  This feature may not be available on all devices. Please refer to the
5801  specific device data sheet to determine availability or use
5802  PLIB_USART_ExistsReceiverParityErrorStatus in your application to determine
5803  whether this feature is available.
5804 */
5805 
5806 bool
5808  USART_MODULE_ID index ) ;
5809 //******************************************************************************
5810 /* Function:
5811  bool PLIB_USART_ReceiverOverrunHasOccurred ( USART_MODULE_ID index )
5812  Summary:
5813  Identifies if there was a receiver overrun error.
5814  Description:
5815  This function identifies if there was a receiver overrun error.
5816  This operation is atomic.
5817  Precondition:
5818  None.
5819  Parameters:
5820  index - Identifier for the device instance to be configured
5821  Returns:
5822  - true - The receive buffer has overflowed
5823  - false - The receive buffer has not overflowed
5824  Example:
5825  <code>
5826 #define MY_USART_INSTANCE USART_ID_1
5827  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5828  {
5829  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5830  }
5831  </code>
5832  Remarks:
5833  This feature may not be available on all devices. Please refer to the
5834  specific device data sheet to determine availability or use
5835  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
5836  whether this feature is available.
5837 */
5838 
5839 bool
5841  USART_MODULE_ID index ) ;
5842 //******************************************************************************
5843 /* Function:
5844  bool PLIB_USART_ReceiverIsIdle ( USART_MODULE_ID index )
5845  Summary:
5846  Identifies if the receiver is idle.
5847  Description:
5848  This function identifies if the receiver is idle.
5849  This operation is atomic.
5850  Precondition:
5851  None.
5852  Parameters:
5853  index - Identifier for the device instance to be configured
5854  Returns:
5855  - true - The receive buffer is idle
5856  - false - The receive buffer is not idle
5857  Example:
5858  <code>
5859 #define MY_USART_INSTANCE USART_ID_1
5860  int8_t mydata;
5861  if(PLIB_USART_ReceiverIsIdle(MY_USART_INSTANCE))
5862  {
5863  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5864  }
5865  </code>
5866  Remarks:
5867  This feature may not be available on all devices. Please refer to the
5868  specific device data sheet to determine availability or use
5869  PLIB_USART_ExistsReceiverIdleStatus in your application to determine
5870  whether this feature is available.
5871 */
5872 
5873 bool
5875  USART_MODULE_ID index ) ;
5876 //******************************************************************************
5877 /* Function:
5878  void PLIB_USART_ReceiverEnable ( USART_MODULE_ID index )
5879  Summary:
5880  Enables the USART receiver.
5881  Description:
5882  This function enables the USART receiver.
5883  This operation is atomic.
5884  Precondition:
5885  None.
5886  Parameters:
5887  index - Identifier for the device instance to be configured
5888  Returns:
5889  None.
5890  Example:
5891  <code>
5892 #define MY_USART_INSTANCE USART_ID_1
5893  PLIB_USART_ReceiverEnable(MY_USART_INSTANCE);
5894  </code>
5895  Remarks:
5896  This feature may not be available on all devices. Please refer to the
5897  specific device data sheet to determine availability or use
5898  PLIB_USART_ExistsReceiverEnable in your application to determine
5899  whether this feature is available.
5900 */
5901 
5902 void
5904  USART_MODULE_ID index ) ;
5905 //******************************************************************************
5906 /* Function:
5907  void PLIB_USART_ReceiverDisable ( USART_MODULE_ID index )
5908  Summary:
5909  Disables the USART receiver.
5910  Description:
5911  This function disables the USART receiver.
5912  This operation is atomic.
5913  Precondition:
5914  None.
5915  Parameters:
5916  index - Identifier for the device instance to be configured
5917  Returns:
5918  None.
5919  Example:
5920  <code>
5921 #define MY_USART_INSTANCE USART_ID_1
5922  PLIB_USART_ReceiverDisable(MY_USART_INSTANCE);
5923  </code>
5924  Remarks:
5925  This feature may not be available on all devices. Please refer to the
5926  specific device data sheet to determine availability or use
5927  PLIB_USART_ExistsReceiverEnable in your application to determine
5928  whether this feature is available.
5929 */
5930 
5931 void
5933  USART_MODULE_ID index ) ;
5934 //******************************************************************************
5935 /* Function:
5936  void PLIB_USART_TransmitterIdleIsLowEnable ( USART_MODULE_ID index )
5937  Summary:
5938  Enables the Transmit Idle Low state.
5939  Description:
5940  This function enables the Transmit Idle Low state. In the USART Synchronous
5941  mode, this function configures that the TX polarity, the idle state is low.
5942  When IrDA is enabled, this function sets that IrDA encoded Transmit Idle
5943  state to a '1'.
5944  This operation is atomic.
5945  Precondition:
5946  None.
5947  Parameters:
5948  index - Identifier for the device instance to be configured
5949  Returns:
5950  None.
5951  Example:
5952  <code>
5953 #define MY_USART_INSTANCE USART_ID_1
5954  PLIB_USART_TransmitterIdleIsLowEnable(MY_USART_INSTANCE);
5955  </code>
5956  Remarks:
5957  This feature may not be available on all devices. Please refer to the
5958  specific device data sheet to determine availability or use
5959  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
5960  whether this feature is available.
5961 */
5962 
5963 void
5965  USART_MODULE_ID index ) ;
5966 //******************************************************************************
5967 /* Function:
5968  void PLIB_USART_TransmitterIdleIsLowDisable ( USART_MODULE_ID index )
5969  Summary:
5970  Disables the Transmit Idle Low state.
5971  Description:
5972  This function disables the Transmit Idle Low state. In USART Synchronous mode,
5973  this function configures that the TX polarity the idle state is high.
5974  When IrDA is enabled, this function sets the IrDA encoded Transmit Idle
5975  state to a '0'.
5976  This operation is atomic.
5977  Precondition:
5978  None.
5979  Parameters:
5980  index - Identifier for the device instance to be configured
5981  Returns:
5982  None.
5983  Example:
5984  <code>
5985 #define MY_USART_INSTANCE USART_ID_1
5986  PLIB_USART_TransmitterIdleIsLowDisable(MY_USART_INSTANCE);
5987  </code>
5988  Remarks:
5989  This feature may not be available on all devices. Please refer to the
5990  specific device data sheet to determine availability or use
5991  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
5992  whether this feature is available.
5993 */
5994 
5995 void
5997  USART_MODULE_ID index ) ;
5998 //******************************************************************************
5999 /* Function:
6000  void PLIB_USART_ReceiverIdleStateLowEnable ( USART_MODULE_ID index )
6001  Summary:
6002  Enables receive polarity inversion.
6003  Description:
6004  This function enables receive polarity inversion. In the USART Synchronous mode,
6005  this function configures that the data is inverted.
6006  This operation is atomic.
6007  Precondition:
6008  None.
6009  Parameters:
6010  index - Identifier for the device instance to be configured
6011  Returns:
6012  None.
6013  Example:
6014  <code>
6015 #define MY_USART_INSTANCE USART_ID_1
6016  PLIB_USART_ReceiverIdleStateLowEnable(MY_USART_INSTANCE);
6017  </code>
6018  Remarks:
6019  This feature may not be available on all devices. Please refer to the
6020  specific device data sheet to determine availability or use
6021  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6022  whether this feature is available.
6023 */
6024 
6025 void
6027  USART_MODULE_ID index ) ;
6028 //******************************************************************************
6029 /* Function:
6030  void PLIB_USART_ReceiverIdleStateLowDisable ( USART_MODULE_ID index );
6031  Summary:
6032  Disables receive polarity inversion.
6033  This operation is atomic.
6034  Description:
6035  This function disables receive polarity inversion. In the USART Synchronous
6036  mode, this function configures that the data is not inverted.
6037  Precondition:
6038  None.
6039  Parameters:
6040  index - Identifier for the device instance to be configured
6041  Returns:
6042  None.
6043  Example:
6044  <code>
6045 #define MY_USART_INSTANCE USART_ID_1
6046  PLIB_USART_ReceiverIdleStateLowDisable(MY_USART_INSTANCE);
6047  </code>
6048  Remarks:
6049  This feature may not be available on all devices. Please refer to the
6050  specific device data sheet to determine availability or use
6051  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6052  whether this feature is available.
6053 */
6054 
6055 void
6057  USART_MODULE_ID index ) ;
6058 //******************************************************************************
6059 /* Function:
6060  void PLIB_USART_BaudRateHighEnable ( USART_MODULE_ID index )
6061  Summary:
6062  Enables high baud rate selection.
6063  Description:
6064  This function enables high baud rate selection.
6065  This operation is atomic.
6066  Precondition:
6067  None.
6068  Parameters:
6069  index - Identifier for the device instance to be configured
6070  Returns:
6071  None.
6072  Example:
6073  <code>
6074 #define MY_USART_INSTANCE USART_ID_1
6075  PLIB_USART_BaudRateHighEnable(MY_USART_INSTANCE);
6076  </code>
6077  Remarks:
6078  This feature may not be available on all devices. Please refer to the
6079  specific device data sheet to determine availability or use
6080  PLIB_USART_ExistsBaudRateHigh in your application to determine
6081  whether this feature is available.
6082 */
6083 
6084 void
6086  USART_MODULE_ID index ) ;
6087 //******************************************************************************
6088 /* Function:
6089  void PLIB_USART_BaudRateHighDisable ( USART_MODULE_ID index )
6090  Summary:
6091  Disables the high baud rate selection.
6092  Description:
6093  This function disables the high baud rate selection.
6094  This operation is atomic.
6095  Precondition:
6096  None.
6097  Parameters:
6098  index - Identifier for the device instance to be configured
6099  Returns:
6100  None.
6101  Example:
6102  <code>
6103 #define MY_USART_INSTANCE USART_ID_1
6104  PLIB_USART_BaudRateHighDisable(MY_USART_INSTANCE);
6105  </code>
6106  Remarks:
6107  This feature may not be available on all devices. Please refer to the
6108  specific device data sheet to determine availability or use
6109  PLIB_USART_ExistsBaudRateHigh in your application to determine
6110  whether this feature is available.
6111 */
6112 
6113 void
6115  USART_MODULE_ID index ) ;
6116 //******************************************************************************
6117 /* Function:
6118  void PLIB_USART_TransmitterInterruptModeSelect( USART_MODULE_ID index,
6119  USART_TRANSMIT_INTR_MODE interruptMode )
6120  Summary:
6121  Sets the USART transmitter interrupt mode.
6122  Description:
6123  This function sets the condition in which the USART module should generate
6124  an interrupt.
6125  This operation is atomic.
6126  Precondition:
6127  None.
6128  Parameters:
6129  index - Identifier for the device instance to be configured
6130  interruptMode - Interrupt mode; for possible configurations, refer to
6131  USART_TRANSMIT_INTR_MODE
6132  Returns:
6133  None.
6134  Example:
6135  <code>
6136 #define MY_USART_INSTANCE USART_ID_1
6137  PLIB_USART_TransmitterInterruptModeSelect(MY_USART_INSTANCE,
6138  USART_TRANSMIT_FIFO_EMPTY );
6139  </code>
6140  Remarks:
6141  This feature may not be available on all devices. Please refer to the
6142  specific device data sheet to determine availability or use
6143  PLIB_USART_ExistsTransmitterInterruptMode in your application to determine
6144  whether this feature is available.
6145 */
6146 
6147 void
6149  USART_MODULE_ID index ,
6150  USART_TRANSMIT_INTR_MODE fifolevel ) ;
6151 //******************************************************************************
6152 /* Function:
6153  void PLIB_USART_ReceiverInterruptModeSelect( USART_MODULE_ID index,
6154  USART_RECEIVE_INTR_MODE interruptMode )
6155  Summary:
6156  Sets the USART receiver FIFO level.
6157  Description:
6158  This function sets the USART receiver FIFO level.
6159  This operation is atomic.
6160  Precondition:
6161  None.
6162  Parameters:
6163  index - Identifier for the device instance to be configured
6164  fifolevel - For possible configurations, refer to USART_RECEIVE_INTR_MODE
6165  Returns:
6166  None.
6167  Example:
6168  <code>
6169 #define MY_USART_INSTANCE USART_ID_1
6170  PLIB_USART_ReceiverInterruptModeSelect(MY_USART_INSTANCE,
6171  USART_RECEIVE_FIFO_ONE_CHAR );
6172  </code>
6173  Remarks:
6174  This feature may not be available on all devices. Please refer to the
6175  specific device data sheet to determine availability or use
6176  PLIB_USART_ExistsReceiverInterruptMode in your application to determine
6177  whether this feature is available.
6178 */
6179 
6180 void
6182  USART_MODULE_ID index ,
6183  USART_RECEIVE_INTR_MODE interruptMode ) ;
6184 //******************************************************************************
6185 /* Function:
6186  void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index,
6187  USART_LINECONTROL_MODE dataFlowConfig)
6188  Summary:
6189  Sets the data flow configuration.
6190  Description:
6191  This function sets the USART data flow configuration based on the mask
6192  provided and the specified baud rate.
6193  Precondition:
6194  None.
6195  Parameters:
6196  index - Identifier for the device instance to be configured
6197  mode - For possible data flow configurations, refer to
6198  USART_LINECONTROL_MODE
6199  Returns:
6200  None.
6201  Example:
6202  <code>
6203 #define MY_USART_INSTANCE USART_ID_1
6204  PLIB_USART_LineControlModeSelect(MY_USART_INSTANCE, \
6205  USART_8N1);
6206  </code>
6207  Remarks:
6208  This feature may not be available on all devices. Please refer to the
6209  specific device data sheet to determine availability or use
6210  PLIB_USART_ExistsLineControlMode in your application to determine
6211  whether this feature is available.
6212 */
6213 
6214 void
6216  USART_MODULE_ID index ,
6217  USART_LINECONTROL_MODE dataFlowConfig ) ;
6218 //******************************************************************************
6219 /* Function:
6220  void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index,
6221  USART_HANDSHAKE_MODE handshakeConfig)
6222  Summary:
6223  Sets the data flow configuration.
6224  Description:
6225  This function sets the USART data flow configuration based on the mask
6226  provided and the specified baud rate.
6227  Precondition:
6228  None.
6229  Parameters:
6230  index - Identifier for the device instance to be configured
6231  mode - For possible data flow configurations, refer to
6232  USART_HANDSHAKE_MODE
6233  Returns:
6234  None.
6235  Example:
6236  <code>
6237 #define MY_USART_INSTANCE USART_ID_1
6238  PLIB_USART_HandshakeModeSelect(MY_USART_INSTANCE, \
6239  USART_HANDSHAKE_MODE_SIMPLEX);
6240  </code>
6241  Remarks:
6242  This feature may not be available on all devices. Please refer to the
6243  specific device data sheet to determine availability or use
6244  PLIB_USART_ExistsHandshakeMode in your application to determine
6245  whether this feature is available.
6246 */
6247 
6248 void
6250  USART_MODULE_ID index ,
6251  USART_HANDSHAKE_MODE handshakeConfig ) ;
6252 //******************************************************************************
6253 /* Function:
6254  void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index,
6255  int8_t Mask)
6256  Summary:
6257  Setup the automatic Address Detect mode.
6258  Description:
6259  This function configures the automatic Address Detect mode. Uses the mask as
6260  the address character for automatic address detection.
6261  This operation is atomic.
6262  Precondition:
6263  None.
6264  Parameters:
6265  index - Identifier for the device instance to be configured
6266  Mask - Address character to be used, when enabled
6267  Returns:
6268  None.
6269  Example:
6270  <code>
6271 #define MY_USART_INSTANCE USART_ID_1
6272  PLIB_USART_ReceiverAddressAutoDetectEnable(MY_USART_INSTANCE,
6273  MY_DEVICE_ADDRESS);
6274  </code>
6275  Remarks:
6276  This feature may not be available on all devices. Please refer to the
6277  specific device data sheet to determine availability or use
6278  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6279  whether this feature is available.
6280 */
6281 
6282 void
6284  USART_MODULE_ID index ,
6285  int8_t Mask ) ;
6286 //******************************************************************************
6287 /* Function:
6288  void PLIB_USART_ReceiverAddressAutoDetectDisable (
6289  USART_MODULE_ID index )
6290  Summary:
6291  Disables the automatic Address Detect mode.
6292  Description:
6293  This function disables the automatic Address Detect mode.
6294  This operation is atomic.
6295  Precondition:
6296  None.
6297  Parameters:
6298  index - Identifier for the device instance to be configured
6299  Returns:
6300  None.
6301  Example:
6302  <code>
6303 #define MY_USART_INSTANCE USART_ID_1
6304  PLIB_USART_ReceiverAddressAutoDetectDisable(MY_USART_INSTANCE);
6305  </code>
6306  Remarks:
6307  This feature may not be available on all devices. Please refer to the
6308  specific device data sheet to determine availability or use
6309  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6310  whether this feature is available.
6311 */
6312 
6313 void
6315  USART_MODULE_ID index ) ;
6316 //******************************************************************************
6317 /* Function:
6318  void PLIB_USART_IrDAEnable ( USART_MODULE_ID index )
6319  Summary:
6320  Enables the IrDA encoder and decoder.
6321  Description:
6322  This function enables the IrDA encoder and decoder.
6323  This operation is atomic.
6324  Precondition:
6325  None.
6326  Parameters:
6327  index - Identifier for the device instance to be configured
6328  Returns:
6329  None.
6330  Example:
6331  <code>
6332 #define MY_USART_INSTANCE USART_ID_1
6333  PLIB_USART_IrDAEnable(MY_USART_INSTANCE);
6334  </code>
6335  Remarks:
6336  This feature may not be available on all devices. Please refer to the
6337  specific device data sheet to determine availability or use
6338  PLIB_USART_ExistsIrDA in your application to determine
6339  whether this feature is available.
6340 */
6341 
6342 void
6344  USART_MODULE_ID index ) ;
6345 //******************************************************************************
6346 /* Function:
6347  void PLIB_USART_IrDADisable ( USART_MODULE_ID index )
6348  Summary:
6349  Disables the IrDA encoder and decoder.
6350  Description:
6351  This function disables the IrDA encoder and decoder.
6352  This operation is atomic.
6353  Precondition:
6354  None.
6355  Parameters:
6356  index - Identifier for the device instance to be configured
6357  Returns:
6358  None.
6359  Example:
6360  <code>
6361 #define MY_USART_INSTANCE USART_ID_1
6362  PLIB_USART_IrDADisable(MY_USART_INSTANCE);
6363  </code>
6364  Remarks:
6365  By default, the IrDA Encoder and Decoder are disabled.
6366 
6367  This feature may not be available on all devices. Please refer to the
6368  specific device data sheet to determine availability or use
6369  PLIB_USART_ExistsIrDA in your application to determine
6370  whether this feature is available.
6371 */
6372 
6373 void
6375  USART_MODULE_ID index ) ;
6376 //******************************************************************************
6377 /* Function:
6378  void PLIB_USART_LoopbackEnable ( USART_MODULE_ID index )
6379  Summary:
6380  Enables Loopback mode.
6381  Description:
6382  This function enables Loopback mode.
6383  This operation is atomic.
6384  Precondition:
6385  None.
6386  Parameters:
6387  index - Identifier for the device instance to be configured
6388  Returns:
6389  None.
6390  Example:
6391  <code>
6392 #define MY_USART_INSTANCE USART_ID_1
6393  PLIB_USART_LoopbackEnable(MY_USART_INSTANCE);
6394  </code>
6395  Remarks:
6396  By default, Loopback mode is disabled.
6397 
6398  This feature may not be available on all devices. Please refer to the
6399  specific device data sheet to determine availability or use
6400  PLIB_USART_ExistsLoopback in your application to determine
6401  whether this feature is available.
6402 */
6403 
6404 void
6406  USART_MODULE_ID index ) ;
6407 //******************************************************************************
6408 /* Function:
6409  void PLIB_USART_LoopbackDisable ( USART_MODULE_ID index )
6410  Summary:
6411  Disables Loopback mode.
6412  Description:
6413  This function disables Loopback mode.
6414  This operation is atomic.
6415  Precondition:
6416  None.
6417  Parameters:
6418  index - Identifier for the device instance to be configured
6419  Returns:
6420  None.
6421  Example:
6422  <code>
6423 #define MY_USART_INSTANCE USART_ID_1
6424  PLIB_USART_LoopbackDisable(MY_USART_INSTANCE);
6425  </code>
6426  Remarks:
6427  By default, Loopback mode is disabled.
6428  This feature may not be available on all devices. Please refer to the
6429  specific device data sheet to determine availability or use
6430  PLIB_USART_ExistsLoopback in your application to determine
6431  whether this feature is available.
6432 */
6433 
6434 void
6436  USART_MODULE_ID index ) ;
6437 //******************************************************************************
6438 /* Function:
6439  void PLIB_USART_OperationModeSelect(USART_MODULE_ID index,
6440  USART_OPERATION_MODE operationmode)
6441  Summary:
6442  Configures the operation mode of the USART module.
6443  Description:
6444  This function configures the operation mode of the USART (i.e., controls the
6445  pins used by the USART module). Refer to USART_OPERATION_MODE for the
6446  possible settings.
6447  Precondition:
6448  None.
6449  Parameters:
6450  index - Identifier for the device instance to be configured
6451  operationmode - One of the possible values from USART_OPERATION_MODE
6452  Returns:
6453  None.
6454  Example:
6455  <code>
6456 #define MY_USART_INSTANCE USART_ID_1
6457  PLIB_USART_OperationModeSelect(MY_USART_INSTANCE, USART_ENABLE_TX_RX_BCLK_USED);
6458  </code>
6459  Remarks:
6460  This feature may not be available on all devices. Please refer to the
6461  specific device data sheet to determine availability or use
6462  PLIB_USART_ExistsOperationMode in your application to determine
6463  whether this feature is available.
6464 */
6465 
6466 void
6468  USART_MODULE_ID index ,
6469  USART_OPERATION_MODE operationmode ) ;
6470 //******************************************************************************
6471 /* Function:
6472  void PLIB_USART_StopInIdleEnable ( USART_MODULE_ID index )
6473  Summary:
6474  Discontinues operation when the device enters Idle mode.
6475  Description:
6476  This function enables the USART module to discontinue operation when the
6477  device enters Idle mode.
6478  This operation is atomic.
6479  Precondition:
6480  None.
6481  Parameters:
6482  index - Identifier for the device instance to be configured
6483  Returns:
6484  None.
6485  Example:
6486  <code>
6487 #define MY_USART_INSTANCE USART_ID_1
6488  PLIB_USART_StopInIdleEnable(MY_USART_INSTANCE);
6489  </code>
6490  Remarks:
6491  This feature may not be available on all devices. Please refer to the
6492  specific device data sheet to determine availability or use
6493  PLIB_USART_ExistsStopInIdle in your application to determine
6494  whether this feature is available.
6495 */
6496 
6497 void
6499  USART_MODULE_ID index ) ;
6500 //******************************************************************************
6501 /* Function:
6502  void PLIB_USART_StopInIdleDisable ( USART_MODULE_ID index )
6503  Summary:
6504  Disables the Stop in Idle mode (the USART module continues operation when
6505  the device is in Idle mode).
6506  Description:
6507  This function disables the Stop in Idle mode. The USART module continues
6508  operation when the device is in Idle mode.
6509  This operation is atomic.
6510  Precondition:
6511  None.
6512  Parameters:
6513  index - Identifier for the device instance to be configured
6514  Returns:
6515  None.
6516  Example:
6517  <code>
6518 #define MY_USART_INSTANCE USART_ID_1
6519  PLIB_USART_StopInIdleDisable(MY_USART_INSTANCE);
6520  </code>
6521  Remarks:
6522  By default, the USART module will continue operation in Idle mode.
6523 
6524  This feature may not be available on all devices. Please refer to the
6525  specific device data sheet to determine availability or use
6526  PLIB_USART_ExistsStopInIdle in your application to determine
6527  whether this feature is available.
6528 */
6529 
6530 void
6532  USART_MODULE_ID index ) ;
6533 //******************************************************************************
6534 /* Function:
6535  void PLIB_USART_WakeOnStartEnable ( USART_MODULE_ID index )
6536  Summary:
6537  Enables the wake-up on start bit detection feature during Sleep mode.
6538  Description:
6539  This function enables the wake-up on start feature during Sleep mode.
6540  This operation is atomic.
6541  Precondition:
6542  None.
6543  Parameters:
6544  index - Identifier for the device instance to be configured
6545  Returns:
6546  None.
6547  Example:
6548  <code>
6549 #define MY_USART_INSTANCE USART_ID_1
6550  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
6551  </code>
6552  Remarks:
6553  This feature may not be available on all devices. Please refer to the
6554  specific device data sheet to determine availability or use
6555  PLIB_USART_ExistsWakeOnStart in your application to determine
6556  whether this feature is available.
6557 */
6558 
6559 void
6561  USART_MODULE_ID index ) ;
6562 //******************************************************************************
6563 /* Function:
6564  void PLIB_USART_WakeOnStartDisable ( USART_MODULE_ID index )
6565  Summary:
6566  Disables the wake-up on start bit detection feature during Sleep mode.
6567  Description:
6568  This function disables the wake-up on start bit detection feature during
6569  Sleep mode.
6570  This operation is atomic.
6571  Precondition:
6572  None.
6573  Parameters:
6574  index - Identifier for the device instance to be configured
6575  Returns:
6576  None.
6577  Example:
6578  <code>
6579 #define MY_USART_INSTANCE USART_ID_1
6580  PLIB_USART_WakeOnStartDisable(MY_USART_INSTANCE);
6581  </code>
6582  Remarks:
6583  This feature may not be available on all devices. Please refer to the
6584  specific device data sheet to determine availability or use
6585  PLIB_USART_ExistsWakeOnStart in your application to determine
6586  whether this feature is available.
6587 */
6588 
6589 void
6591  USART_MODULE_ID index ) ;
6592 //******************************************************************************
6593 /* Function:
6594  bool PLIB_USART_WakeOnStartIsEnabled ( USART_MODULE_ID index )
6595  Summary:
6596  Gets the state of the sync break event completion.
6597  Description:
6598  This function returns the status of the sync break event, when called
6599  after enabling using PLIB_USART_WakeOnStartEnable.
6600  This operation is atomic.
6601  Precondition:
6602  None.
6603  Parameters:
6604  index - Identifier for the device instance to be configured
6605  Returns:
6606  None.
6607  Example:
6608  <code>
6609 #define MY_USART_INSTANCE USART_ID_1
6610  //Call the interface just prior to entering the sleep mode.
6611  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
6612  // Check the status if the Sync break event is over.
6613  if(PLIB_USART_WakeOnStartIsEnabled(MY_USART_INSTANCE))
6614  {
6615  // Do Something
6616  }
6617  </code>
6618  Remarks:
6619  This feature may not be available on all devices. Please refer to the
6620  specific device data sheet to determine availability or use
6621  PLIB_USART_ExistsWakeOnStart in your application to determine
6622  whether this feature is available.
6623 */
6624 
6625 bool
6627  USART_MODULE_ID index ) ;
6628 //******************************************************************************
6629 /* Function:
6630  void PLIB_USART_InitializeModeGeneral( USART_MODULE_ID index, bool autobaud,
6631  bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle );
6632  Summary:
6633  Enables or disables general features of the USART module.
6634  Description:
6635  This function enables or disables general features of the USART module.
6636  Precondition:
6637  None.
6638  Parameters:
6639  index - Identifier for the device instance to be configured
6640  autobaud - If true, auto baud rate detection is enabled. If false
6641  the feature is disabled.
6642  loopBackMode - If true, loop back is enabled. If false the feature is
6643  disabled.
6644  wakeFromSleep - If true, the USART module will wake up the CPU from sleep
6645  mode on USART activity. If false the feature is disabled.
6646  irdaMode - If true, the IrDA mode is enabled. If false the feature
6647  is disabled.
6648  stopInIdle - If true, module will stop functioning when CPU enters Idle
6649  mode. If false, the feature is disabled.
6650  Returns:
6651  None.
6652  Example:
6653  <code>
6654 #define MY_USART_INSTANCE USART_ID_1
6655  // Enable loopback, disable IrDA, disable auto baud detection and disable
6656  // wake from sleep. Enable stop in idle
6657  PLIB_USART_InitializeModeGeneral(MY_USART_INSTANCE, false, true,
6658  false, false, true);
6659  </code>
6660  Remarks:
6661  Enabling the wake from sleep feature will cause the first character that is
6662  received by the USART module to be discarded. This feature should only be
6663  enabled if the CPU is to placed in power saving mode.
6664 
6665  This feature may not be available on all devices. Please refer to the
6666  specific device data sheet to determine availability. Availability of this
6667  function can also be determined if all of the following functions return
6668  true:
6669  - PLIB_USART_ExistsLoopback
6670  - PLIB_USART_ExistsBaudRateAutoDetect
6671  - PLIB_USART_ExistsWakeOnStart
6672  - PLIB_USART_ExistsIrDA
6673  - PLIB_USART_ExistsStopInIdle
6674 */
6675 
6676 void
6678  USART_MODULE_ID index ,
6679  bool autobaud ,
6680  bool loopBackMode ,
6681  bool wakeFromSleep ,
6682  bool irdaMode ,
6683  bool stopInIdle ) ;
6684 //******************************************************************************
6685 /* Function:
6686  void PLIB_USART_InitializeOperation( USART_MODULE_ID index ,
6687  USART_RECEIVE_INTR_MODE receiveInterruptMode,
6688  USART_TRANSMIT_INTR_MODE transmitInterruptMode,
6689  USART_OPERATION_MODE operationMode);
6690  Summary:
6691  Configures the Receive and Transmit FIFO interrupt levels and the hardware
6692  lines to be used by the module.
6693  Description:
6694  This function configures the Receive and Transmit FIFO interrupt levels and
6695  the hardware lines to be used by the module.
6696  Precondition:
6697  None.
6698  Parameters:
6699  index - Identifier for the device instance to be configured
6700  receiveInterruptMode - Receiver FIFO interrupt level
6701  transmitInterruptMode - Transmit FIFO interrupt level
6702  operationMode - Hardware lines to be used by the USART.
6703  Returns:
6704  None.
6705  Example:
6706  <code>
6707 #define MY_USART_INSTANCE USART_ID_1
6708  // Set receive FIFO to interrupt when FIFO is 3/4 level full
6709  // Set Transmit FIFO to interrupt when FIFO is empty
6710  // USART module will only use RX and TX hardware lines
6711  PLIB_USART_InitializeOperation(MY_USART_INSTANCE, USART_RECEIVE_FIFO_3B4FULL,
6712  USART_TRANSMIT_FIFO_EMPTY , USART_ENABLE_TX_RX_USED);
6713  </code>
6714  Remarks:
6715  This feature may not be available on all devices. Please refer to the
6716  specific device data sheet to determine availability. Availability of this
6717  function can also be determined if all of the following functions return
6718  true:
6719  - PLIB_USART_ExistsReceiverInterruptMode
6720  - PLIB_USART_ExistsTransmitterInterruptMode
6721  - PLIB_USART_ExistsOperationMode
6722 */
6723 
6724 void
6726  USART_MODULE_ID index ,
6727  USART_RECEIVE_INTR_MODE receiveInterruptMode ,
6728  USART_TRANSMIT_INTR_MODE transmitInterruptMode ,
6729  USART_OPERATION_MODE operationMode ) ;
6730 //******************************************************************************
6731 /* Function:
6732  void PLIB_USART_BaudSetAndEnable ( USART_MODULE_ID index, uint32_t
6733  clockFrequency, uint32_t baudRate );
6734  Summary:
6735  Sets the baud rate to the desired value and enables the USART receiver,
6736  transmitter and the USART module.
6737  Description:
6738  This function sets the baud rate to the desired value and enables the USART
6739  receiver, USART transmitter and USART module.
6740  Precondition:
6741  None.
6742  Parameters:
6743  index - Identifier for the device instance to be configured
6744  baudRate - Baud Rate Value
6745  clockFrequency - Clock Frequency
6746  Returns:
6747  None.
6748  Example:
6749  <code>
6750 #define MY_USART_INSTANCE USART_ID_1
6751  uint32_t baudRateValue ;
6752  PLIB_USART_BaudSetAndEnable(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
6753  </code>
6754  Remarks:
6755  Setting a new baud rate value causes the baud rate timer to reset.
6756  This ensures that the baud rate timer does not have to overflow before
6757  outputting the new baud rate.
6758 
6759  If the system clock is changed during an active receive operation, a
6760  receiver error or data loss may result. To avoid this issue verify that
6761  no receptions are in progress before changing the system clock.
6762 
6763  This feature may not be available on all devices. Please refer to the
6764  specific device data sheet to determine availability. Availability of this
6765  function can also be determined if all of the following functions return
6766  true:
6767  - PLIB_USART_ExistsBaudRate
6768  - PLIB_USART_ExistsTransmitterEnable
6769  - PLIB_USART_ExistsReceiverEnable
6770  - PLIB_USART_ExistsEnable
6771 */
6772 
6773 void
6775  USART_MODULE_ID index ,
6776  uint32_t systemClock ,
6777  uint32_t baud ) ;
6778 //******************************************************************************
6779 /* Function:
6780  USART_ERROR PLIB_USART_ErrorsGet ( USART_MODULE_ID index )
6781  Summary:
6782  Return the status of all errors in the specified USART module.
6783  Description:
6784  This function returns status of all errors in the specified USART module.
6785  The return value can be bitwise AND'ed with a USART_ERROR type to know the
6786  status of a specific error.
6787  This operation is atomic.
6788  Precondition:
6789  None.
6790  Parameters:
6791  index - Identifier for the device instance to be configured
6792  Returns:
6793  Returns a bitmap of USART error status.
6794  Example:
6795  <code>
6796 #define MY_USART_INSTANCE USART_ID_1
6797  USART_ERROR error;
6798  // Get the status of all errors.
6799  error = PLIB_USART_ErrorsGet(MY_USART_INSTANCE);
6800  // Check if parity error is active
6801  if(error & USART_ERROR_PARITY)
6802  {
6803  // Parity error is active.
6804  }
6805  else if(error & USART_ERROR_FRAMING)
6806  {
6807  // Framing error is active.
6808  }
6809  </code>
6810  Remarks:
6811  This feature may not be available on all devices. Please refer to the
6812  specific device data sheet to determine availability. Availability of this
6813  function can also be determined if all of the followings functions return
6814  true:
6815  - PLIB_USART_ExistsReceiverFramingErrorStatus
6816  - PLIB_USART_ExistsReceiverParityErrorStatus
6817  - PLIB_USART_ExistsReceiverOverrunStatus
6818 */
6819 
6820 USART_ERROR
6822  USART_MODULE_ID index ) ;
6823 //******************************************************************************
6824 /* Function:
6825  PLIB_USART_TransmitterAddressGet( USART_MODULE_ID index )
6826  Summary:
6827  Returns the address of the USART TX register
6828  Description:
6829  This function returns the address of the USART TX register.
6830  This operation is atomic.
6831  Preconditions:
6832  None.
6833  Parameters:
6834  index - Identifier for the device instance
6835  Returns:
6836  Address of the USART TX register
6837  Remarks:
6838  None.
6839 */
6840 
6841 void *
6843  USART_MODULE_ID index ) ;
6844 //******************************************************************************
6845 /* Function:
6846  PLIB_USART_ReceiverAddressGet( USART_MODULE_ID index )
6847  Summary:
6848  Returns the address of the USART RX register
6849  Description:
6850  This function returns the address of the USART RX register.
6851  This operation is atomic.
6852  Preconditions:
6853  None.
6854  Parameters:
6855  index - Identifier for the device instance
6856  Returns:
6857  Address of the USART RX register
6858  Remarks:
6859  None.
6860 */
6861 
6862 void *
6864  USART_MODULE_ID index ) ;
6865 // *****************************************************************************
6866 // *****************************************************************************
6867 // Section: USART Peripheral Library Exists Functions
6868 // *****************************************************************************
6869 // *****************************************************************************
6870 /* The following functions indicate the existence of the features on the device.
6871 */
6872 //******************************************************************************
6873 /* Function:
6874  PLIB_USART_ExistsRunInOverflow ( USART_MODULE_ID index )
6875  Summary:
6876  Identifies whether the Run in overflow condition feature exists on the USART module.
6877  Description:
6878  This function identifies whether the Run in Overflow condition feature is
6879  available on the USART module. When this function returns true, these
6880  functions are supported on the device:
6881  - PLIB_USART_RunInOverflowEnable
6882  - PLIB_USART_RunInOverflowDisable
6883  - PLIB_USART_RunInOverflowIsEnabled
6884  This operation is atomic.
6885  Preconditions:
6886  None.
6887  Parameters:
6888  index - Identifier for the device instance
6889  Returns:
6890  - true - The Run in Overflow condition feature is supported on the device
6891  - false - The Run in Overflow condition feature is not supported on the device
6892  Remarks:
6893  None.
6894 */
6895 
6896 bool
6898  USART_MODULE_ID index ) ;
6899 //******************************************************************************
6900 /* Function:
6901  PLIB_USART_ExistsBRGClockSourceSelect ( USART_MODULE_ID index )
6902  Summary:
6903  Identifies whether the BRG Clock source select feature exists on the
6904  USART module.
6905  Description:
6906  This function identifies whether the BRG Clock source select feature is
6907  available on the USART module. When this function returns true, these
6908  functions are supported on the device:
6909  - PLIB_USART_BRGClockSourceSelect
6910  - PLIB_USART_BRGClockSourceGet
6911  This operation is atomic.
6912  Preconditions:
6913  None.
6914  Parameters:
6915  index - Identifier for the device instance
6916  Returns:
6917  - true - The BRG clock source select feature is supported on the device
6918  - false - The BRG clock source select feature is not supported on the device
6919  Remarks:
6920  None.
6921 */
6922 
6923 bool
6925  USART_MODULE_ID index ) ;
6926 //******************************************************************************
6927 /* Function:
6928  PLIB_USART_ExistsModuleBusyStatus ( USART_MODULE_ID index )
6929  Summary:
6930  Identifies whether the module running status feature exists on the
6931  USART module.
6932  Description:
6933  This function identifies whether the module running status feature is
6934  available on the USART module. When this function returns true, this
6935  function is supported on the device:
6936  - PLIB_USART_ModuleIsBusy
6937  This operation is atomic.
6938  Preconditions:
6939  None.
6940  Parameters:
6941  index - Identifier for the device instance
6942  Returns:
6943  - true - The Module running status feature is supported on the device
6944  - false - The Module running status feature is not supported on the device
6945  Remarks:
6946  None.
6947 */
6948 
6949 bool
6951  USART_MODULE_ID index ) ;
6952 //******************************************************************************
6953 /* Function:
6954  PLIB_USART_ExistsRunInSleepMode ( USART_MODULE_ID index )
6955  Summary:
6956  Identifies whether the Run in Sleep mode feature exists on the USART module.
6957  Description:
6958  This function identifies whether the Run in Sleep mode feature is
6959  available on the USART module. When this function returns true, these
6960  functions are supported on the device:
6961  - PLIB_USART_RunInSleepModeEnable
6962  - PLIB_USART_RunInSleepModeDisable
6963  - PLIB_USART_RunInSleepModeIsEnabled
6964  This operation is atomic.
6965  Preconditions:
6966  None.
6967  Parameters:
6968  index - Identifier for the device instance
6969  Returns:
6970  - true - The Run in Sleep mode feature is supported on the device
6971  - false - The Run in Sleep mode feature is not supported on the device
6972  Remarks:
6973  None.
6974 */
6975 
6976 bool
6978  USART_MODULE_ID index ) ;
6979 //******************************************************************************
6980 /* Function:
6981  PLIB_USART_ExistsEnable( USART_MODULE_ID index )
6982  Summary:
6983  Identifies whether the EnableControl feature exists on the USART module.
6984  Description:
6985  This function identifies whether the EnableControl feature is
6986  available on the USART module. When this function returns true, these
6987  functions are supported on the device:
6988  - PLIB_USART_Disable
6989  - PLIB_USART_Enable
6990  This operation is atomic.
6991  Preconditions:
6992  None.
6993  Parameters:
6994  index - Identifier for the device instance
6995  Returns:
6996  - true - The EnableControl feature is supported on the device
6997  - false - The EnableControl feature is not supported on the device
6998  Remarks:
6999  None.
7000 */
7001 
7002 bool
7004  USART_MODULE_ID index ) ;
7005 //******************************************************************************
7006 /* Function:
7007  PLIB_USART_ExistsHandshakeMode( USART_MODULE_ID index )
7008  Summary:
7009  Identifies whether the HandShakeMode feature exists on the USART module.
7010  Description:
7011  This function identifies whether the HandShakeMode feature is
7012  available on the USART module. When this function returns true, this
7013  function is supported on the device:
7014  - PLIB_USART_HandshakeModeSelect
7015  This operation is atomic.
7016  Preconditions:
7017  None.
7018  Parameters:
7019  index - Identifier for the device instance
7020  Returns:
7021  - true - The HandShakeMode feature is supported on the device
7022  - false - The HandShakeMode feature is not supported on the device
7023  Remarks:
7024  None.
7025 */
7026 
7027 bool
7029  USART_MODULE_ID index ) ;
7030 //******************************************************************************
7031 /* Function:
7032  PLIB_USART_ExistsIrDA( USART_MODULE_ID index )
7033  Summary:
7034  Identifies whether the IrDAControl feature exists on the USART module.
7035  Description:
7036  This function identifies whether the IrDAControl feature is
7037  available on the USART module. When this function returns true, these
7038  functions are supported on the device:
7039  - PLIB_USART_IrDADisable
7040  - PLIB_USART_IrDAEnable
7041  This operation is atomic.
7042  Preconditions:
7043  None.
7044  Parameters:
7045  index - Identifier for the device instance
7046  Returns:
7047  - true - The IrDAControl feature is supported on the device
7048  - false - The IrDAControl feature is not supported on the device
7049  Remarks:
7050  None.
7051 */
7052 
7053 bool
7055  USART_MODULE_ID index ) ;
7056 //******************************************************************************
7057 /* Function:
7058  PLIB_USART_ExistsLineControlMode( USART_MODULE_ID index )
7059  Summary:
7060  Identifies whether the LineControlMode feature exists on the USART module.
7061  Description:
7062  This function identifies whether the LineControlMode feature is
7063  available on the USART module. When this function returns true, this
7064  function is supported on the device:
7065  - PLIB_USART_LineControlModeSelect
7066  This operation is atomic.
7067  Preconditions:
7068  None.
7069  Parameters:
7070  index - Identifier for the device instance
7071  Returns:
7072  - true - The LineControlMode feature is supported on the device
7073  - false - The LineControlMode feature is not supported on the device
7074  Remarks:
7075  None.
7076 */
7077 
7078 bool
7080  USART_MODULE_ID index ) ;
7081 //******************************************************************************
7082 /* Function:
7083  PLIB_USART_ExistsLoopback( USART_MODULE_ID index )
7084  Summary:
7085  Identifies whether the Loopback feature exists on the USART module.
7086  Description:
7087  This function identifies whether the Loopback feature is
7088  available on the USART module. When this function returns true, these
7089  functions are supported on the device:
7090  - PLIB_USART_LoopbackEnable
7091  - PLIB_USART_LoopbackDisable
7092  This operation is atomic.
7093  Preconditions:
7094  None.
7095  Parameters:
7096  index - Identifier for the device instance
7097  Returns:
7098  - true - The Loopback feature is supported on the device
7099  - false - The Loopback feature is not supported on the device
7100  Remarks:
7101  None.
7102 */
7103 
7104 bool
7106  USART_MODULE_ID index ) ;
7107 //******************************************************************************
7108 /* Function:
7109  PLIB_USART_ExistsOperationMode( USART_MODULE_ID index )
7110  Summary:
7111  Identifies whether the OperationMode feature exists on the USART module.
7112  Description:
7113  This function identifies whether the OperationMode feature is
7114  available on the USART module. When this function returns true, this
7115  function is supported on the device:
7116  - PLIB_USART_OperationModeSelect
7117  This operation is atomic.
7118  Preconditions:
7119  None.
7120  Parameters:
7121  index - Identifier for the device instance
7122  Returns:
7123  - true - The OperationMode feature is supported on the device
7124  - false - The OperationMode feature is not supported on the device
7125  Remarks:
7126  None.
7127 */
7128 
7129 bool
7131  USART_MODULE_ID index ) ;
7132 //******************************************************************************
7133 /* Function:
7134  PLIB_USART_ExistsStopInIdle( USART_MODULE_ID index )
7135  Summary:
7136  Identifies whether the StopInIdle feature exists on the USART module.
7137  Description:
7138  This function identifies whether the StopInIdle feature is
7139  available on the USART module. When this function returns true, these
7140  functions are supported on the device:
7141  - PLIB_USART_StopInIdleEnable
7142  - PLIB_USART_StopInIdleDisable
7143  This operation is atomic.
7144  Preconditions:
7145  None.
7146  Parameters:
7147  index - Identifier for the device instance
7148  Returns:
7149  - true - The StopInIdle feature is supported on the device
7150  - false - The StopInIdle feature is not supported on the device
7151  Remarks:
7152  None.
7153 */
7154 
7155 bool
7157  USART_MODULE_ID index ) ;
7158 //******************************************************************************
7159 /* Function:
7160  PLIB_USART_ExistsWakeOnStart( USART_MODULE_ID index )
7161  Summary:
7162  Identifies whether the WakeOnStart feature exists on the USART module.
7163  Description:
7164  This function identifies whether the WakeOnStart feature is
7165  available on the USART module. When this function returns true, these
7166  functions are supported on the device:
7167  - PLIB_USART_WakeOnStartEnable
7168  - PLIB_USART_WakeOnStartDisable
7169  - PLIB_USART_WakeOnStartIsEnabled
7170  This operation is atomic.
7171  Preconditions:
7172  None.
7173  Parameters:
7174  index - Identifier for the device instance
7175  Returns:
7176  - true - The WakeOnStart feature is supported on the device
7177  - false - The WakeOnStart feature is not supported on the device
7178  Remarks:
7179  None.
7180 */
7181 
7182 bool
7184  USART_MODULE_ID index ) ;
7185 //******************************************************************************
7186 /* Function:
7187  PLIB_USART_ExistsBaudRate( USART_MODULE_ID index )
7188  Summary:
7189  Identifies whether the BaudRate feature exists on the USART module.
7190  Description:
7191  This function identifies whether the BaudRate feature is
7192  available on the USART module. When this function returns true, these
7193  functions are supported on the device:
7194  - PLIB_USART_BaudRateSet
7195  - PLIB_USART_BaudRateGet
7196  This operation is atomic.
7197  Preconditions:
7198  None.
7199  Parameters:
7200  index - Identifier for the device instance
7201  Returns:
7202  - true - The BaudRate feature is supported on the device
7203  - false - The BaudRate feature is not supported on the device
7204  Remarks:
7205  None.
7206 */
7207 
7208 bool
7210  USART_MODULE_ID index ) ;
7211 //******************************************************************************
7212 /* Function:
7213  PLIB_USART_ExistsBaudRateAutoDetect( USART_MODULE_ID index )
7214  Summary:
7215  Identifies whether the BaudRateAutoDetect feature exists on the USART module.
7216  Description:
7217  This function identifies whether the BaudRateAutoDetect feature is
7218  available on the USART module. When this function returns true, these
7219  functions are supported on the device:
7220  - PLIB_USART_BaudRateAutoDetectEnable
7221  - PLIB_USART_BaudRateAutoDetectIsComplete
7222  This operation is atomic.
7223  Preconditions:
7224  None.
7225  Parameters:
7226  index - Identifier for the device instance
7227  Returns:
7228  - true - The BaudRateAutoDetect feature is supported on the device
7229  - false - The BaudRateAutoDetect feature is not supported on the device
7230  Remarks:
7231  None.
7232 */
7233 
7234 bool
7236  USART_MODULE_ID index ) ;
7237 //******************************************************************************
7238 /* Function:
7239  PLIB_USART_ExistsBaudRateHigh( USART_MODULE_ID index )
7240  Summary:
7241  Identifies whether the BaudRateHigh feature exists on the USART module.
7242  Description:
7243  This function identifies whether the BaudRateHigh feature is
7244  available on the USART module. When this function returns true, these
7245  functions are supported on the device:
7246  - PLIB_USART_BaudRateHighSet
7247  - PLIB_USART_BaudRateHighDisable
7248  - PLIB_USART_BaudRateHighEnable
7249  This operation is atomic.
7250  Preconditions:
7251  None.
7252  Parameters:
7253  index - Identifier for the device instance
7254  Returns:
7255  - true - The BaudRateHigh feature is supported on the device
7256  - false - The BaudRateHigh feature is not supported on the device
7257  Remarks:
7258  None.
7259 */
7260 
7261 bool
7263  USART_MODULE_ID index ) ;
7264 //******************************************************************************
7265 /* Function:
7266  PLIB_USART_ExistsReceiverAddress ( USART_MODULE_ID index )
7267  Summary:
7268  Identifies whether the Receiver Address feature exists on the USART
7269  module.
7270  Description:
7271  This function identifies whether the Receiver Address feature is
7272  available on the USART module. When this function returns true, these
7273  functions are supported on the device:
7274  - PLIB_USART_AddressSet
7275  - PLIB_USART_AddressGet
7276  This operation is atomic.
7277  Preconditions:
7278  None.
7279  Parameters:
7280  index - Identifier for the device instance
7281  Returns:
7282  - true - The Receiver address feature is supported on the device
7283  - false - The Receiver address feature is not supported on the device
7284  Remarks:
7285  None.
7286 */
7287 
7288 bool
7290  USART_MODULE_ID index ) ;
7291 //******************************************************************************
7292 /* Function:
7293  PLIB_USART_ExistsReceiverAddressMask ( USART_MODULE_ID index )
7294  Summary:
7295  Identifies whether the Receiver Address Mask feature exists on the USART
7296  module.
7297  Description:
7298  This function identifies whether the Receiver Address Mask feature is
7299  available on the USART module. When this function returns true, these
7300  functions are supported on the device:
7301  - PLIB_USART_AddressMaskSet
7302  - PLIB_USART_AddressMaskGet
7303  This operation is atomic.
7304  Preconditions:
7305  None.
7306  Parameters:
7307  index - Identifier for the device instance
7308  Returns:
7309  - true - The Receiver address mask feature is supported on the device
7310  - false - The Receiver address mask feature is not supported on the device
7311  Remarks:
7312  None.
7313 */
7314 
7315 bool
7317  USART_MODULE_ID index ) ;
7318 //******************************************************************************
7319 /* Function:
7320  PLIB_USART_ExistsReceiver( USART_MODULE_ID index )
7321  Summary:
7322  Identifies whether the Receiver feature exists on the USART module.
7323  Description:
7324  This function identifies whether the Receiver feature is available on the
7325  USART module. When this function returns true, these functions are supported
7326  on the device:
7327  - PLIB_USART_ReceiverByteReceive
7328  - PLIB_USART_ReceiverAddressGet
7329  This operation is atomic.
7330  Preconditions:
7331  None.
7332  Parameters:
7333  index - Identifier for the device instance
7334  Returns:
7335  - true - The Receiver feature is supported on the device
7336  - false - The Receiver feature is not supported on the device
7337  Remarks:
7338  None.
7339 */
7340 
7341 bool
7343  USART_MODULE_ID index ) ;
7344 //******************************************************************************
7345 /* Function:
7346  PLIB_USART_ExistsReceiver9Bits ( USART_MODULE_ID index )
7347  Summary:
7348  Identifies whether the 9 Bits Receiver feature exists on the USART module.
7349  Description:
7350  This function identifies whether the 9 Bits Receiver feature is available on the
7351  USART module. When this function returns true, this function is supported
7352  on the device:
7353  - PLIB_USART_Receiver9BitsReceive
7354  This operation is atomic.
7355  Preconditions:
7356  None.
7357  Parameters:
7358  index - Identifier for the device instance
7359  Returns:
7360  - true - The feature is supported on the device
7361  - false - The feature is not supported on the device
7362  Remarks:
7363  None.
7364 */
7365 
7366 bool
7368  USART_MODULE_ID index ) ;
7369 //******************************************************************************
7370 /* Function:
7371  PLIB_USART_ExistsReceiverAddressAutoDetect( USART_MODULE_ID index )
7372  Summary:
7373  Identifies whether the ReceiverAddressAutoDetect feature exists on the USART module.
7374  Description:
7375  This function identifies whether the ReceiverAddressAutoDetect feature is
7376  available on the USART module. When this function returns true, these
7377  functions are supported on the device:
7378  - PLIB_USART_ReceiverAddressAutoDetectEnable
7379  - PLIB_USART_ReceiverAddressAutoDetectDisable
7380  This operation is atomic.
7381  Preconditions:
7382  None.
7383  Parameters:
7384  index - Identifier for the device instance
7385  Returns:
7386  - true - The ReceiverAddressAutoDetect feature is supported on the device
7387  - false - The ReceiverAddressAutoDetect feature is not supported on the device
7388  Remarks:
7389  None.
7390 */
7391 
7392 bool
7394  USART_MODULE_ID index ) ;
7395 //******************************************************************************
7396 /* Function:
7397  PLIB_USART_ExistsReceiverAddressDetect( USART_MODULE_ID index )
7398  Summary:
7399  Identifies whether the ReceiverAddressDetect feature exists on the USART module.
7400  Description:
7401  This function identifies whether the ReceiverAddressDetect feature is
7402  available on the USART module. When this function returns true, these
7403  functions are supported on the device:
7404  - PLIB_USART_ReceiverAddressDetectEnable
7405  - PLIB_USART_ReceiverAddressDetectDisable
7406  - PLIB_USART_ReceiverAddressIsReceived
7407  This operation is atomic.
7408  Preconditions:
7409  None.
7410  Parameters:
7411  index - Identifier for the device instance
7412  Returns:
7413  - true - The ReceiverAddressDetect feature is supported on the device
7414  - false - The ReceiverAddressDetect feature is not supported on the device
7415  Remarks:
7416  None.
7417 */
7418 
7419 bool
7421  USART_MODULE_ID index ) ;
7422 //******************************************************************************
7423 /* Function:
7424  PLIB_USART_ExistsReceiverDataAvailableStatus( USART_MODULE_ID index )
7425  Summary:
7426  Identifies whether the ReceiverDataAvailable feature exists on the USART
7427  module
7428  Description:
7429  This function identifies whether the ReceiverDataAvailable feature is
7430  available on the USART module. When this function returns true, this
7431  function is supported on the device:
7432  - PLIB_USART_ReceiverDataIsAvailable
7433  This operation is atomic.
7434  Preconditions:
7435  None.
7436  Parameters:
7437  index - Identifier for the device instance
7438  Returns:
7439  - true - The ReceiverDataAvailable feature is supported on the device
7440  - false - The ReceiverDataAvailable feature is not supported on the device
7441  Remarks:
7442  None.
7443 */
7444 
7445 bool
7447  USART_MODULE_ID index ) ;
7448 //******************************************************************************
7449 /* Function:
7450  PLIB_USART_ExistsReceiverEnable( USART_MODULE_ID index )
7451  Summary:
7452  Identifies whether the ReceiverEnableControl feature exists on the USART module.
7453  Description:
7454  This function identifies whether the ReceiverEnableControl feature is
7455  available on the USART module. When this function returns true, these
7456  functions are supported on the device:
7457  - PLIB_USART_ReceiverEnable
7458  - PLIB_USART_ReceiverDisable
7459  This operation is atomic.
7460  Preconditions:
7461  None.
7462  Parameters:
7463  index - Identifier for the device instance
7464  Returns:
7465  - true - The ReceiverEnableControl feature is supported on the device
7466  - false - The ReceiverEnableControl feature is not supported on the device
7467  Remarks:
7468  None.
7469 */
7470 
7471 bool
7473  USART_MODULE_ID index ) ;
7474 //******************************************************************************
7475 /* Function:
7476  PLIB_USART_ExistsReceiverIdleStatus( USART_MODULE_ID index )
7477  Summary:
7478  Identifies whether the ReceiverIdle feature exists on the USART module.
7479  Description:
7480  This function identifies whether the ReceiverIdle feature is
7481  available on the USART module. When this function returns true, this
7482  function is supported on the device:
7483  - PLIB_USART_ReceiverIsIdle
7484  This operation is atomic.
7485  Preconditions:
7486  None.
7487  Parameters:
7488  index - Identifier for the device instance
7489  Returns:
7490  - true - The ReceiverIdle feature is supported on the device
7491  - false - The ReceiverIdle feature is not supported on the device
7492  Remarks:
7493  None.
7494 */
7495 
7496 bool
7498  USART_MODULE_ID index ) ;
7499 //******************************************************************************
7500 /* Function:
7501  PLIB_USART_ExistsReceiverFramingErrorStatus( USART_MODULE_ID index )
7502  Summary:
7503  Identifies whether the ReceiverFramingError feature exists on the USART module.
7504  Description:
7505  This function identifies whether the ReceiverFramingError feature is
7506  available on the USART module. When this function returns true, this
7507  function is supported on the device:
7508  - PLIB_USART_ReceiverFramingErrorHasOccurred
7509  This operation is atomic.
7510  Preconditions:
7511  None.
7512  Parameters:
7513  index - Identifier for the device instance
7514  Returns:
7515  - true - The ReceiverFramingError feature is supported on the device
7516  - false - The ReceiverFramingError feature is not supported on the device
7517  Remarks:
7518  None.
7519 */
7520 
7521 bool
7523  USART_MODULE_ID index ) ;
7524 //******************************************************************************
7525 /* Function:
7526  PLIB_USART_ExistsReceiverInterruptMode( USART_MODULE_ID index )
7527  Summary:
7528  Identifies whether the ReceiverInterruptMode feature exists on the USART module.
7529  Description:
7530  This function identifies whether the ReceiverInterruptMode feature is
7531  available on the USART module. When this function returns true, this
7532  function is supported on the device:
7533  - PLIB_USART_ReceiverInterruptModeSelect
7534  This operation is atomic.
7535  Preconditions:
7536  None.
7537  Parameters:
7538  index - Identifier for the device instance
7539  Returns:
7540  - true - The ReceiverInterruptMode feature is supported on the device
7541  - false - The ReceiverInterruptMode feature is not supported on the device
7542  Remarks:
7543  None.
7544 */
7545 
7546 bool
7548  USART_MODULE_ID index ) ;
7549 //******************************************************************************
7550 /* Function:
7551  PLIB_USART_ExistsReceiverIdleStateLowEnable( USART_MODULE_ID index )
7552  Summary:
7553  Identifies whether the ReceiverPolarityInvert feature exists on the USART module.
7554  Description:
7555  This function identifies whether the ReceiverPolarityInvert feature is
7556  available on the USART module. When this function returns true, these
7557  functions are supported on the device:
7558  - PLIB_USART_ReceiverIdleStateLowEnable
7559  - PLIB_USART_ReceiverIdleStateLowDisable
7560  This operation is atomic.
7561  Preconditions:
7562  None.
7563  Parameters:
7564  index - Identifier for the device instance
7565  Returns:
7566  - true - The ReceiverPolarityInvert feature is supported on the device
7567  - false - The ReceiverPolarityInvert feature is not supported on the device
7568  Remarks:
7569  None.
7570 */
7571 
7572 bool
7574  USART_MODULE_ID index ) ;
7575 //******************************************************************************
7576 /* Function:
7577  PLIB_USART_ExistsReceiverParityErrorStatus( USART_MODULE_ID index )
7578  Summary:
7579  Identifies whether the ReceiverParityError feature exists on the USART module.
7580  Description:
7581  This function identifies whether the ReceiverParityError feature is
7582  available on the USART module. When this function returns true, this
7583  function is supported on the device:
7584  - PLIB_USART_ReceiverParityErrorHasOccurred
7585  This operation is atomic.
7586  Preconditions:
7587  None.
7588  Parameters:
7589  index - Identifier for the device instance
7590  Returns:
7591  - true - The ReceiverParityError feature is supported on the device
7592  - false - The ReceiverParityError feature is not supported on the device
7593  Remarks:
7594  None.
7595 */
7596 
7597 bool
7599  USART_MODULE_ID index ) ;
7600 //******************************************************************************
7601 /* Function:
7602  PLIB_USART_ExistsReceiverOverrunStatus( USART_MODULE_ID index )
7603  Summary:
7604  Identifies whether the ReceiverOverrunError feature exists on the USART module.
7605  Description:
7606  This function identifies whether the ReceiverOverrunError feature is
7607  available on the USART module. When this function returns true, these
7608  functions are supported on the device:
7609  - PLIB_USART_ReceiverOverrunErrorClear
7610  - PLIB_USART_ReceiverOverrunHasOccurred
7611  This operation is atomic.
7612  Preconditions:
7613  None.
7614  Parameters:
7615  index - Identifier for the device instance
7616  Returns:
7617  - true - The ReceiverOverrunError feature is supported on the device
7618  - false - The ReceiverOverrunError feature is not supported on the device
7619  Remarks:
7620  None.
7621 */
7622 
7623 bool
7625  USART_MODULE_ID index ) ;
7626 //******************************************************************************
7627 /* Function:
7628  PLIB_USART_ExistsTransmitter( USART_MODULE_ID index )
7629  Summary:
7630  Identifies whether the Transmitter feature exists on the USART module.
7631  Description:
7632  This function identifies whether the Transmitter feature is
7633  available on the USART module. When this function returns true, these
7634  functions are supported on the device:
7635  - PLIB_USART_TransmitterByteSend
7636  - PLIB_USART_TransmitterAddressGet
7637  This operation is atomic.
7638  Preconditions:
7639  None.
7640  Parameters:
7641  index - Identifier for the device instance
7642  Returns:
7643  - true - The Transmitter feature is supported on the device
7644  - false - The Transmitter feature is not supported on the device
7645  Remarks:
7646  None.
7647 */
7648 
7649 bool
7651  USART_MODULE_ID index ) ;
7652 //******************************************************************************
7653 /* Function:
7654  PLIB_USART_ExistsTransmitter9BitsSend( USART_MODULE_ID index )
7655  Summary:
7656  Identifies whether the Transmitter9Bits feature exists on the USART module.
7657  Description:
7658  This function identifies whether the Transmitter9Bits feature is
7659  available on the USART module. When this function returns true, this
7660  function is supported on the device:
7661  - PLIB_USART_Transmitter9BitsSend
7662  This operation is atomic.
7663  Preconditions:
7664  None.
7665  Parameters:
7666  index - Identifier for the device instance
7667  Returns:
7668  - true - The Transmitter9Bits feature is supported on the device
7669  - false - The Transmitter9Bits feature is not supported on the device
7670  Remarks:
7671  None.
7672 */
7673 
7674 bool
7676  USART_MODULE_ID index ) ;
7677 //******************************************************************************
7678 /* Function:
7679  PLIB_USART_ExistsTransmitterBreak( USART_MODULE_ID index )
7680  Summary:
7681  Identifies whether the TransmitterBreak feature exists on the USART module.
7682  Description:
7683  This function identifies whether the TransmitterBreak feature is
7684  available on the USART module. When this function returns true, these
7685  functions are supported on the device:
7686  - PLIB_USART_TransmitterBreakSend
7687  - PLIB_USART_TransmitterBreakSendIsComplete
7688  This operation is atomic.
7689  Preconditions:
7690  None.
7691  Parameters:
7692  index - Identifier for the device instance
7693  Returns:
7694  - true - The TransmitterBreak feature is supported on the device
7695  - false - The TransmitterBreak feature is not supported on the device
7696  Remarks:
7697  None.
7698 */
7699 
7700 bool
7702  USART_MODULE_ID index ) ;
7703 //******************************************************************************
7704 /* Function:
7705  PLIB_USART_ExistsTransmitterBufferFullStatus( USART_MODULE_ID index )
7706  Summary:
7707  Identifies whether the TransmitterBufferFull feature exists on the USART module.
7708  Description:
7709  This function identifies whether the TransmitterBufferFull feature is
7710  available on the USART module. When this function returns true, this
7711  function is supported on the device:
7712  - PLIB_USART_TransmitterBufferIsFull
7713  This operation is atomic.
7714  Preconditions:
7715  None.
7716  Parameters:
7717  index - Identifier for the device instance
7718  Returns:
7719  - true - The TransmitterBufferFull feature is supported on the device
7720  - false - The TransmitterBufferFull feature is not supported on the device
7721  Remarks:
7722  None.
7723 */
7724 
7725 bool
7727  USART_MODULE_ID index ) ;
7728 //******************************************************************************
7729 /* Function:
7730  PLIB_USART_ExistsTransmitterEmptyStatus( USART_MODULE_ID index )
7731  Summary:
7732  Identifies whether the TransmitterEmpty feature exists on the USART module.
7733  Description:
7734  This function identifies whether the TransmitterEmpty feature is
7735  available on the USART module. When this function returns true, this
7736  function is supported on the device:
7737  - PLIB_USART_TransmitterIsEmpty
7738  This operation is atomic.
7739  Preconditions:
7740  None.
7741  Parameters:
7742  index - Identifier for the device instance
7743  Returns:
7744  - true - The TransmitterEmpty feature is supported on the device
7745  - false - The TransmitterEmpty feature is not supported on the device
7746  Remarks:
7747  None.
7748 */
7749 
7750 bool
7752  USART_MODULE_ID index ) ;
7753 //******************************************************************************
7754 /* Function:
7755  PLIB_USART_ExistsTransmitterEnable( USART_MODULE_ID index )
7756  Summary:
7757  Identifies whether the TransmitterEnableControl feature exists on the USART
7758  module
7759  Description:
7760  This function identifies whether the TransmitterEnableControl feature is
7761  available on the USART module. When this function returns true, these
7762  functions are supported on the device:
7763  - PLIB_USART_TransmitterEnable
7764  - PLIB_USART_TransmitterDisable
7765  This operation is atomic.
7766  Preconditions:
7767  None.
7768  Parameters:
7769  index - Identifier for the device instance
7770  Returns:
7771  - true - The TransmitterEnableControl feature is supported on the device
7772  - false - The TransmitterEnableControl feature is not supported on the device
7773  Remarks:
7774  None.
7775 */
7776 
7777 bool
7779  USART_MODULE_ID index ) ;
7780 //******************************************************************************
7781 /* Function:
7782  PLIB_USART_ExistsTransmitterInterruptMode( USART_MODULE_ID index )
7783  Summary:
7784  Identifies whether the TransmitterInterruptMode feature exists on the USART module.
7785  Description:
7786  This function identifies whether the TransmitterInterruptMode feature is
7787  available on the USART module. When this function returns true, this function
7788  is supported on the device:
7789  - PLIB_USART_TransmitterInterruptModeSelect
7790  This operation is atomic.
7791  Preconditions:
7792  None.
7793  Parameters:
7794  index - Identifier for the device instance
7795  Returns:
7796  - true - The TransmitterInterruptMode feature is supported on the device
7797  - false - The TransmitterInterruptMode feature is not supported on the device
7798  Remarks:
7799  None.
7800 */
7801 
7802 bool
7804  USART_MODULE_ID index ) ;
7805 //******************************************************************************
7806 /* Function:
7807  PLIB_USART_ExistsTransmitterIdleIsLow( USART_MODULE_ID index )
7808  Summary:
7809  Identifies whether the TransmitterIdleIsLow feature exists on the USART module.
7810  Description:
7811  This function identifies whether the TransmitterIdleIsLow feature is available
7812  on the USART module. When this function returns true, these functions are
7813  supported on the device:
7814  - PLIB_USART_TransmitterIdleIsLowDisable
7815  - PLIB_USART_TransmitterIdleIsLowEnable
7816  This operation is atomic.
7817  Preconditions:
7818  None.
7819  Parameters:
7820  index - Identifier for the device instance
7821  Returns:
7822  - true - The TransmitterIdleIsLow feature is supported on the device
7823  - false - The TransmitterIdleIsLow feature is not supported on the device
7824  Remarks:
7825  None.
7826 */
7827 
7828 bool
7830  USART_MODULE_ID index ) ;
7831 //DOM-IGNORE-BEGIN
7832 //DOM-IGNORE-END
7833  // #ifndef _PLIB_USART_H
7834 /******************************************************************************
7835  End of File
7836 */
7837 
7838 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h*/
7839 /* CLOSE_FILE Include File */
7840 
7841 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\system.h */
7842 /*******************************************************************************
7843  System Services Library Interface Header
7844  Company:
7845  Microchip Technology Inc.
7846  File Name:
7847  system.h
7848  Summary:
7849  Top level common system services library interface header.
7850  Description:
7851  This file is the top level common system services library interface header.
7852  It defines (or includes files that define) the common system service
7853  types, prototypes, and other definitions that are commonly used by MPLAB
7854  Harmony libraries and system services.
7855 
7856  System services provide common functionality that would otherwise need to
7857  be duplicated by multiple other modules or that would force them to
7858  interact in complex and hard to manage ways. System services eliminate
7859  conflicts by controlling access shared resources.
7860  Remarks:
7861  The parent directory to the "system" directory should be added to the
7862  compiler's search path for header files such that the following include
7863  statment will successfully include this file.
7864 
7865 #include "system/system.h"
7866  *******************************************************************************/
7867 //DOM-IGNORE-BEGIN
7868 /*******************************************************************************
7869 Copyright (c) 2011-2015 released Microchip Technology Inc. All rights reserved.
7870 Microchip licenses to you the right to use, modify, copy and distribute
7871 Software only when embedded on a Microchip microcontroller or digital signal
7872 controller that is integrated into your product or third party product
7873 (pursuant to the sublicense terms in the accompanying license agreement).
7874 You should refer to the license agreement accompanying this Software for
7875 additional information regarding your rights and obligations.
7876 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
7877 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7878 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7879 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7880 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7881 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7882 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7883 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7884 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7885 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7886  *******************************************************************************/
7887 //DOM-IGNORE-END
7888 #ifndef _SYSTEM_H
7889 #define _SYSTEM_H
7890 // *****************************************************************************
7891 // *****************************************************************************
7892 // Section: Included Files
7893 // *****************************************************************************
7894 // *****************************************************************************
7895 #include "system/common/sys_common.h"
7896 #include "system/common/sys_module.h"
7897 // DOM-IGNORE-BEGIN
7898 // DOM-IGNORE-END
7899 //DOM-IGNORE-BEGIN
7900 //DOM-IGNORE-END
7901  // _SYSTEM_H
7902 /*******************************************************************************
7903  End of File
7904 */
7905 #endif /*00 C:\microchip\harmony\v2_06\framework\system\system.h*/
7906 /* CLOSE_FILE Include File */
7907 
7908 #include "system/int/sys_int.h"
7909 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h */
7910 /*******************************************************************************
7911  DMA System Service Library Interface Definition
7912  Company:
7913  Microchip Technology Inc.
7914  File Name:
7915  sys_dma.h
7916  Summary:
7917  DMA System Service.
7918  Description:
7919  This file contains the interface definition for the DMA System
7920  Service. It provides a way to interact with the DMA subsystem to
7921  manage the data transfer between different peripherals and/or memory
7922  without intervention from the CPU.
7923 *******************************************************************************/
7924 //DOM-IGNORE-BEGIN
7925 /*******************************************************************************
7926 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
7927 Microchip licenses to you the right to use, modify, copy and distribute
7928 Software only when embedded on a Microchip microcontroller or digital signal
7929 controller that is integrated into your product or third party product
7930 (pursuant to the sublicense terms in the accompanying license agreement).
7931 You should refer to the license agreement accompanying this Software for
7932 additional information regarding your rights and obligations.
7933 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
7934 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7935 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7936 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7937 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7938 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7939 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7940 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7941 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7942 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7943 *******************************************************************************/
7944 //DOM-IGNORE-END
7945 #ifndef _SYS_DMA_H
7946 #define _SYS_DMA_H
7947 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h */
7948 /*******************************************************************************
7949  DMA System Service Library Interface Definition
7950  Company:
7951  Microchip Technology Inc.
7952  File Name:
7953  sys_dma_definitions.h
7954  Summary:
7955  DMA System Service data type definitions header.
7956  Description:
7957  This file contains data type definitions header.
7958 *******************************************************************************/
7959 //DOM-IGNORE-BEGIN
7960 /*******************************************************************************
7961 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
7962 Microchip licenses to you the right to use, modify, copy and distribute
7963 Software only when embedded on a Microchip microcontroller or digital signal
7964 controller that is integrated into your product or third party product
7965 (pursuant to the sublicense terms in the accompanying license agreement).
7966 You should refer to the license agreement accompanying this Software for
7967 additional information regarding your rights and obligations.
7968 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
7969 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7970 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7971 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7972 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7973 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7974 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7975 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7976 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7977 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7978 *******************************************************************************/
7979 //DOM-IGNORE-END
7980 #ifndef _SYS_DMA_DEFINITIONS_H
7981 #define _SYS_DMA_DEFINITIONS_H
7982 // *****************************************************************************
7983 // *****************************************************************************
7984 // Section: File includes
7985 // *****************************************************************************
7986 // *****************************************************************************
7987 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
7988 #include "system/common/sys_common.h"
7989 #include "system/common/sys_module.h"
7990 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h */
7991 /*******************************************************************************
7992  DMA Peripheral Library Interface Header
7993  Company:
7994  Microchip Technology Inc.
7995  File Name:
7996  plib_dma.h
7997  Summary:
7998  Defines the DMA Peripheral Library interface functions.
7999  Description:
8000  This header file contains the function prototypes and definitions of
8001  the data types and constants that make up the interface to the Direct Memory
8002  Access (DMA) Peripheral Library for Microchip microcontrollers. The
8003  definitions in this file are for the DMA module.
8004 *******************************************************************************/
8005 // DOM-IGNORE-BEGIN
8006 /*******************************************************************************
8007 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
8008 Microchip licenses to you the right to use, modify, copy and distribute
8009 Software only when embedded on a Microchip microcontroller or digital signal
8010 controller that is integrated into your product or third party product
8011 (pursuant to the sublicense terms in the accompanying license agreement).
8012 You should refer to the license agreement accompanying this Software for
8013 additional information regarding your rights and obligations.
8014 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
8015 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8016 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8017 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8018 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8019 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8020 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8021 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8022 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8023 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8024 *******************************************************************************/
8025 // DOM-IGNORE-END
8026 #ifndef _PLIB_DMA_H
8027 #define _PLIB_DMA_H
8028 // DOM-IGNORE-BEGIN
8029 // DOM-IGNORE-END
8030 // *****************************************************************************
8031 // *****************************************************************************
8032 // Section: Includes
8033 // *****************************************************************************
8034 // *****************************************************************************
8035 /* See Bottom of file for implementation header include files.
8036 */
8037 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h */
8038 //DOM-IGNORE-BEGIN
8039 /*******************************************************************************
8040 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
8041 Microchip licenses to you the right to use, modify, copy and distribute
8042 Software only when embedded on a Microchip microcontroller or digital signal
8043 controller that is integrated into your product or third party product
8044 (pursuant to the sublicense terms in the accompanying license agreement).
8045 You should refer to the license agreement accompanying this Software for
8046 additional information regarding your rights and obligations.
8047 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
8048 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8049 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8050 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8051 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8052 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8053 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8054 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8055 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8056 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8057  *******************************************************************************/
8058 //DOM-IGNORE-END
8059 #ifndef _PLIB_DMA_PROCESSOR_H
8060 #define _PLIB_DMA_PROCESSOR_H
8061 #error "Can't find header"
8062 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h*/
8063 /* CLOSE_FILE Include File */
8064 
8065 // *****************************************************************************
8066 // *****************************************************************************
8067 // Section: Peripheral Library Interface Functions
8068 // *****************************************************************************
8069 // *****************************************************************************
8070 // *****************************************************************************
8071 // *****************************************************************************
8072 // Section: DMA Channel Status Functions
8073 // *****************************************************************************
8074 // *****************************************************************************
8075 //******************************************************************************
8076 /* Function:
8077  bool PLIB_DMA_ChannelXBufferedDataIsWritten ( DMA_MODULE_ID index,
8078  DMA_CHANNEL channel )
8079  Summary:
8080  Returns the buffered data write status for the specified channel.
8081  Description:
8082  This function returns the buffered data write status for the specified channel.
8083  Precondition:
8084  None.
8085  Parameters:
8086  channel - One of the existing DMA channels listed by DMA_CHANNEL
8087  Returns:
8088  - true - The content of the DMA buffer has not been written to the location
8089  specified in the destination/source address or in Null Write mode
8090  - false - The content of the DMA buffer has been written to the location
8091  specified in the destination/source address or in Null Write mode
8092  Example:
8093  <code>
8094  bool chBuffWriteStatus;
8095  chBuffWriteStatus = PLIB_DMA_ChannelXBufferedDataIsWritten( DMA_ID_0,
8096  DMA_CHANNEL_3 );
8097  </code>
8098  Remarks:
8099  This feature is not available on all devices. Please refer to the specific device
8100  data sheet to determine availability.
8101 */
8102 
8103 bool
8105  DMA_MODULE_ID index ,
8106  DMA_CHANNEL channel ) ;
8107 /*******************************************************************************
8108  Function:
8109  bool PLIB_DMA_ChannelXCollisionStatus ( DMA_MODULE_ID index,
8110  DMA_CHANNEL channel,
8111  DMA_CHANNEL_COLLISION collisonType )
8112  Summary:
8113  Returns the status of the specified collision type for the specified channel.
8114  Description:
8115  This function returns the status of the specified collision type for the
8116  specified channel.
8117  Precondition:
8118  None.
8119  Parameters:
8120  channel - One of the existing DMA channels listed by DMA_CHANNEL
8121  collisonType - Collision type listed by DMA_CHANNEL_COLLISION
8122  Returns:
8123  - true - A collision specified by collisonType was detected
8124  - false - No collision of type collisonType was detected
8125  Example:
8126  <code>
8127  bool memWriteCollisionStatus;
8128  memWriteCollisionStatus = PLIB_DMA_ChannelXMemoryWriteCollisionStatus(
8129  DMA_ID_0,
8130  DMA_CHANNEL_3,
8131  DMA_CHANNEL_COLLISION_MEMORY );
8132  </code>
8133  Remarks:
8134  This feature is not available on all devices. Please refer to the specific
8135  device data sheet to determine availability.
8136 */
8137 
8138 bool
8140  DMA_MODULE_ID index ,
8141  DMA_CHANNEL channel ,
8142  DMA_CHANNEL_COLLISION collisonType ) ;
8143 //******************************************************************************
8144 /* Function:
8145  DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet( DMA_MODULE_ID index,
8146  DMA_CHANNEL channel )
8147  Summary:
8148  Returns the Ping-Pong mode status for the specified channel.
8149  Description:
8150  This function returns the Ping-Pong mode status for the specified channel.
8151  Precondition:
8152  None.
8153  Parameters:
8154  channel - One of the existing DMA channels listed by DMA_CHANNEL
8155  Returns:
8156  mode - One of the possible Ping-Pong modes
8157  Example:
8158  <code>
8159  DMA_PING_PONG_MODE chPingPongStatus;
8160  chPingPongStatus = PLIB_DMA_ChannelXPingPongModeGet(DMA_ID_0,
8161  DMA_CHANNEL_3 );
8162  if (DMA_PING_PONG_SECONDARY == chPingPongStatus)
8163  {
8164  \\Application
8165  }
8166  </code>
8167  Remarks:
8168  This feature is not available on all devices. Please refer to the specific
8169  device data sheet to determine availability.
8170 */
8171 
8172 DMA_PING_PONG_MODE
8174  DMA_MODULE_ID index ,
8175  DMA_CHANNEL channel ) ;
8176 //******************************************************************************
8177 /* Function:
8178  bool PLIB_DMA_ChannelXEventIsDetected ( DMA_MODULE_ID index,
8179  DMA_CHANNEL channel )
8180  Summary:
8181  Returns the event status on the specified channel.
8182  Description:
8183  This function returns the event status on the specified channel.
8184  Precondition:
8185  None.
8186  Parameters:
8187  channel - One of the possible DMA channels listed by DMA_CHANNEL
8188  Returns:
8189  - true - An event was detected
8190  - false - No events were detected
8191  Example:
8192  <code>
8193  bool channeleventStatus;
8194  channeleventStatus = PLIB_DMA_ChannelXEventIsDetected( DMA_ID_0,
8195  DMA_CHANNEL_2 );
8196  </code>
8197  Remarks:
8198  This function implements an operation of the ChannelXEvent feature.
8199  This feature may not be available on all devices. Please refer to the
8200  specific device data sheet to determine availability or include the
8201  PLIB_DMA_ExistsChannelXEvent function in your application to determine
8202  whether this feature is available.
8203 */
8204 
8205 bool
8207  DMA_MODULE_ID index ,
8208  DMA_CHANNEL channel ) ;
8209 // *****************************************************************************
8210 // *****************************************************************************
8211 // Section: DMA Channel Configuration Functions
8212 // *****************************************************************************
8213 // *****************************************************************************
8214 //******************************************************************************
8215 /* Function:
8216  void PLIB_DMA_ChannelXPrioritySelect ( DMA_MODULE_ID index,
8217  DMA_CHANNEL channel,
8218  DMA_CHANNEL_PRIORITY channelPriority )
8219  Summary:
8220  Sets the priority of the specified channel.
8221  Description:
8222  This function sets the priority of the specified channel.
8223  Precondition:
8224  None.
8225  Parameters:
8226  channel - One of the existing DMA channels listed by DMA_CHANNEL
8227  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8228  Returns:
8229  None.
8230  Example:
8231  <code>
8232  DMA_CHANNEL channel = DMA_CHANNEL_0;
8233  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_PRIORITY_3;
8234  PLIB_DMA_ChannelXPrioritySelect( DMA_ID_0, channel, channelPriority );
8235  </code>
8236  Remarks:
8237  This function implements an operation of the ChannelXPriority feature.
8238  This feature may not be available on all devices. Please refer to the
8239  specific device data sheet to determine availability or use the
8240  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8241  whether this feature is available.
8242 */
8243 
8244 void
8246  DMA_MODULE_ID index ,
8247  DMA_CHANNEL channel ,
8248  DMA_CHANNEL_PRIORITY channelPriority ) ;
8249 //******************************************************************************
8250 /* Function:
8251  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet ( DMA_MODULE_ID index,
8252  DMA_CHANNEL channel )
8253  Summary:
8254  Gets the priority of the specified channel.
8255  Description:
8256  This function gets the priority of the specified channel.
8257  Precondition:
8258  None.
8259  Parameters:
8260  channel - One of the existing DMA channels listed by DMA_CHANNEL
8261  Returns:
8262  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8263  Example:
8264  <code>
8265  DMA_CHANNEL channel = DMA_CHANNEL_0;
8266  DMA_CHANNEL_PRIORITY channelPriority;
8267  channelPriority = PLIB_DMA_ChannelXPriorityGet( DMA_ID_0, channel );
8268  </code>
8269  Remarks:
8270  This function implements an operation of the ChannelXPriority feature.
8271  This feature may not be available on all devices. Please refer to the
8272  specific device data sheet to determine availability or use the
8273  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8274  whether this feature is available.
8275 */
8276 
8277 DMA_CHANNEL_PRIORITY
8279  DMA_MODULE_ID index ,
8280  DMA_CHANNEL channel ) ;
8281 //******************************************************************************
8282 /* Function:
8283  void PLIB_DMA_ChannelPrioritySelect ( DMA_MODULE_ID index,
8284  DMA_CHANNEL_PRIORITY channelPriority )
8285  Summary:
8286  Sets the priority scheme of the DMA channels.
8287  Description:
8288  This function sets the priority scheme of the DMA channels at the global level.
8289  This function is used in devices that do not have the per channel priority feature.
8290  Precondition:
8291  None.
8292  Parameters:
8293  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8294  Returns:
8295  None.
8296  Example:
8297  <code>
8298  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_ROUND_ROBIN;
8299  PLIB_DMA_ChannelPrioritySelect( DMA_ID_0, channelPriority );
8300  </code>
8301  Remarks:
8302  This feature is not available on all devices. Please refer to the specific
8303  device data sheet to determine availability.
8304 */
8305 
8306 void
8308  DMA_MODULE_ID index ,
8309  DMA_CHANNEL_PRIORITY channelPriority ) ;
8310 //******************************************************************************
8311 /* Function:
8312  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet ( DMA_MODULE_ID index )
8313  Summary:
8314  Gets the priority scheme of the DMA channels.
8315  Description:
8316  This function gets the priority scheme of the DMA channels at the global level.
8317  This function is used in devices that do not have the per channel priority feature.
8318  Precondition:
8319  None.
8320  Parameters:
8321  None.
8322  Returns:
8323  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8324  Example:
8325  <code>
8326  DMA_CHANNEL_PRIORITY channelPriority;
8327  channelPriority = PLIB_DMA_ChannelPriorityGet( DMA_ID_0 );
8328  </code>
8329  Remarks:
8330  This feature is not available on all devices. Please refer to the specific
8331  device data sheet to determine availability.
8332 */
8333 
8334 DMA_CHANNEL_PRIORITY
8336  DMA_MODULE_ID index ) ;
8337 //******************************************************************************
8338 /* Function:
8339  void PLIB_DMA_ChannelXAutoEnable ( DMA_MODULE_ID index,
8340  DMA_CHANNEL channel )
8341  Summary:
8342  Channel is continuously enabled.
8343  Description:
8344  This function enables the channel continuously. The channel is not automatically
8345  disabled after a block transfer is complete.
8346  Precondition:
8347  None.
8348  Parameters:
8349  channel - One of the possible DMA channels listed by DMA_CHANNEL
8350  Returns:
8351  None.
8352  Example:
8353  <code>
8354  PLIB_DMA_ChannelXAutoEnable( DMA_ID_0, DMA_CHANNEL_2 );
8355  </code>
8356  Remarks:
8357  This function implements an operation of the ChannelXAuto feature.
8358  This feature may not be available on all devices. Please refer to the
8359  specific device data sheet to determine availability or use the
8360  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8361  whether this feature is available.
8362 */
8363 
8364 void
8366  DMA_MODULE_ID index ,
8367  DMA_CHANNEL channel ) ;
8368 //******************************************************************************
8369 /* Function:
8370  bool PLIB_DMA_ChannelXAutoIsEnabled ( DMA_MODULE_ID index,
8371  DMA_CHANNEL channel )
8372  Summary:
8373  Returns the channel automatic enable status.
8374  Description:
8375  This function returns the channel automatic enable status.
8376  Precondition:
8377  None.
8378  Parameters:
8379  channel - One of the possible DMA channels listed by DMA_CHANNEL
8380  Returns:
8381  - true - Channel automatic enable is on
8382  - false - Channel automatic enable is off
8383  Example:
8384  <code>
8385  bool ChAutoEnableStatus;
8386  ChAutoEnableStatus = PLIB_DMA_ChannelXAutoIsEnabled(DMA_ID_0, DMA_CHANNEL_2 );
8387  </code>
8388  Remarks:
8389  This function implements an operation of the ChannelXAuto feature.
8390  This feature may not be available on all devices. Please refer to the
8391  specific device data sheet to determine availability or use the
8392  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8393  whether this feature is available.
8394 */
8395 
8396 bool
8398  DMA_MODULE_ID index ,
8399  DMA_CHANNEL channel ) ;
8400 //******************************************************************************
8401 /* Function:
8402  void PLIB_DMA_ChannelXAutoDisable ( DMA_MODULE_ID index,
8403  DMA_CHANNEL channel )
8404  Summary:
8405  Channel is disabled after a block transfer is complete.
8406  Description:
8407  This function disables a channel after a block transfer is complete.
8408  Precondition:
8409  None.
8410  Parameters:
8411  channel - One of the possible DMA channels listed by DMA_CHANNEL
8412  Returns:
8413  None.
8414  Example:
8415  <code>
8416  PLIB_DMA_ChannelXAutoDisable( DMA_ID_0, DMA_CHANNEL_2 );
8417  </code>
8418  Remarks:
8419  This function implements an operation of the ChannelXAuto feature.
8420  This feature may not be available on all devices. Please refer to the
8421  specific device data sheet to determine availability or use the
8422  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8423  whether this feature is available.
8424 */
8425 
8426 void
8428  DMA_MODULE_ID index ,
8429  DMA_CHANNEL channel ) ;
8430 //******************************************************************************
8431 /* Function:
8432  void PLIB_DMA_ChannelXChainEnable ( DMA_MODULE_ID index,
8433  DMA_CHANNEL channel )
8434  Summary:
8435  Channel chain feature is enabled.
8436  Description:
8437  This function enables the channel chain feature.
8438  Precondition:
8439  None.
8440  Parameters:
8441  channel - One of the possible DMA channels listed by DMA_CHANNEL
8442  Returns:
8443  None.
8444  Example:
8445  <code>
8446  PLIB_DMA_ChannelXChainEnable( DMA_ID_0, DMA_CHANNEL_2 );
8447  </code>
8448  Remarks:
8449  This function implements an operation of the ChannelXChainEnbl feature.
8450  This feature may not be available on all devices. Please refer to the
8451  specific device data sheet to determine availability or use the
8452  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8453  whether this feature is available.
8454 */
8455 
8456 void
8458  DMA_MODULE_ID index ,
8459  DMA_CHANNEL channel ) ;
8460 //******************************************************************************
8461 /* Function:
8462  bool PLIB_DMA_ChannelXChainIsEnabled ( DMA_MODULE_ID index,
8463  DMA_CHANNEL channel )
8464  Summary:
8465  Returns the chain status of the specified channel.
8466  Description:
8467  This function returns the chain status of the specified channel.
8468  Precondition:
8469  None.
8470  Parameters:
8471  channel - One of the possible DMA channels listed by DMA_CHANNEL
8472  Returns:
8473  - true - The channel chain is on for this channel
8474  - false - The channel chain is off for this channel
8475  Example:
8476  <code>
8477  bool ChchainStatus;
8478  ChchainStatus = PLIB_DMA_ChannelXChainIsEnabled( DMA_ID_0, DMA_CHANNEL_2 );
8479  </code>
8480  Remarks:
8481  This function implements an operation of the ChannelXChainEnbl feature.
8482  This feature may not be available on all devices. Please refer to the
8483  specific device data sheet to determine availability or use the
8484  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8485  whether this feature is available.
8486 */
8487 
8488 bool
8490  DMA_MODULE_ID index ,
8491  DMA_CHANNEL channel ) ;
8492 //******************************************************************************
8493 /* Function:
8494  void PLIB_DMA_ChannelXChainDisable( DMA_MODULE_ID index,
8495  DMA_CHANNEL channel )
8496  Summary:
8497  Disables the channel chaining for the specified DMA channel.
8498  Description:
8499  This function disables the channel chaining for the specified DMA channel.
8500  Precondition:
8501  None.
8502  Parameters:
8503  channel - One of the possible DMA channels listed by DMA_CHANNEL
8504  Returns:
8505  None.
8506  Example:
8507  <code>
8508  PLIB_DMA_ChannelXChainDisable( DMA_ID_0, DMA_CHANNEL_2 );
8509  </code>
8510  Remarks:
8511  This function implements an operation of the ChannelXChainEnbl feature.
8512  This feature may not be available on all devices. Please refer to the
8513  specific device data sheet to determine availability or use the
8514  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8515  whether this feature is available.
8516 */
8517 
8518 void
8520  DMA_MODULE_ID index ,
8521  DMA_CHANNEL channel ) ;
8522 //******************************************************************************
8523 /* Function:
8524  void PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_MODULE_ID index,
8525  DMA_CHANNEL channel )
8526  Summary:
8527  Channel start/abort events will be registered even if the channel is
8528  disabled.
8529  Description:
8530  This function will allow the channel register start/abort events even if the
8531  channel is disabled.
8532  Precondition:
8533  None.
8534  Parameters:
8535  channel - One of the possible DMA channels listed by DMA_CHANNEL
8536  Returns:
8537  None.
8538  Example:
8539  <code>
8540  PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
8541  </code>
8542  Remarks:
8543  This function implements an operation of the ChannelXDisabled feature.
8544  This feature may not be available on all devices. Please refer to the
8545  specific device data sheet to determine availability or use the
8546  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
8547  determine whether this feature is available.
8548 */
8549 
8550 void
8552  DMA_MODULE_ID index ,
8553  DMA_CHANNEL channel ) ;
8554 //******************************************************************************
8555 /* Function:
8556  void PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_MODULE_ID index,
8557  DMA_CHANNEL channel )
8558  Summary:
8559  Channel start/abort events will be ignored even if the channel is
8560  disabled.
8561  Description:
8562  This function will allow the channel start/abort events to be ignored even if
8563  the channel is disabled.
8564  Precondition:
8565  None.
8566  Parameters:
8567  channel - One of the possible DMA channels listed by DMA_CHANNEL
8568  Returns:
8569  None.
8570  Example:
8571  <code>
8572  PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
8573  </code>
8574  Remarks:
8575  This function implements an operation of the ChannelXDisabled feature.
8576  This feature may not be available on all devices. Please refer to the
8577  specific device data sheet to determine availability or use the
8578  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
8579  determine whether this feature is available.
8580 */
8581 
8582 void
8584  DMA_MODULE_ID index ,
8585  DMA_CHANNEL channel ) ;
8586 //******************************************************************************
8587 /* Function:
8588  void PLIB_DMA_ChannelXEnable ( DMA_MODULE_ID index,
8589  DMA_CHANNEL channel )
8590  Summary:
8591  Enable the specified channel.
8592  Description:
8593  This function will enable the specified channel.
8594  Precondition:
8595  None.
8596  Parameters:
8597  channel - One of the possible DMA channels listed by DMA_CHANNEL
8598  Returns:
8599  None.
8600  Example:
8601  <code>
8602  PLIB_DMA_ChannelXEnable ( DMA_ID_0, DMA_CHANNEL_2 );
8603  </code>
8604  Remarks:
8605  This function implements an operation of the ChannelX feature.
8606  This feature may not be available on all devices. Please refer to the
8607  specific device data sheet to determine availability or use the
8608  PLIB_DMA_ExistsChannelX function in your application to automatically
8609  determine whether this feature is available.
8610 */
8611 
8612 void
8614  DMA_MODULE_ID index ,
8615  DMA_CHANNEL channel ) ;
8616 //******************************************************************************
8617 /* Function:
8618  bool PLIB_DMA_ChannelXIsEnabled ( DMA_MODULE_ID index,
8619  DMA_CHANNEL channel )
8620  Summary:
8621  Return the enable status of the specified channel.
8622  Description:
8623  This function will return the enable status of the specified channel.
8624  Precondition:
8625  None.
8626  Parameters:
8627  channel - One of the possible DMA channels listed by DMA_CHANNEL
8628  Returns:
8629  - true - The specified DMA channel is enabled
8630  - false - The specified DMA channel is disabled
8631  Example:
8632  <code>
8633  bool chEnableStatus;
8634  chEnableStatus = PLIB_DMA_ChannelXIsEnabled ( DMA_ID_0, DMA_CHANNEL_2 );
8635  </code>
8636  Remarks:
8637  This function implements an operation of the ChannelX feature.
8638  This feature may not be available on all devices. Please refer to the
8639  specific device data sheet to determine availability or use the
8640  PLIB_DMA_ExistsChannelX function in your application to automatically
8641  determine whether this feature is available.
8642 */
8643 
8644 bool
8646  DMA_MODULE_ID index ,
8647  DMA_CHANNEL channel ) ;
8648 //******************************************************************************
8649 /* Function:
8650  void PLIB_DMA_ChannelXDisable ( DMA_MODULE_ID index,
8651  DMA_CHANNEL channel )
8652  Summary:
8653  Disable the specified channel.
8654  Description:
8655  This function will disable the specified channel.
8656  Precondition:
8657  None.
8658  Parameters:
8659  channel - One of the possible DMA channels listed by DMA_CHANNEL
8660  Returns:
8661  None.
8662  Example:
8663  <code>
8664  PLIB_DMA_ChannelXDisable ( DMA_ID_0, DMA_CHANNEL_2 );
8665  </code>
8666  Remarks:
8667  This function implements an operation of the ChannelX feature.
8668  This feature may not be available on all devices. Please refer to the
8669  specific device data sheet to determine availability or use the
8670  PLIB_DMA_ExistsChannelX function in your application to automatically
8671  determine whether this feature is available.
8672 */
8673 
8674 void
8676  DMA_MODULE_ID index ,
8677  DMA_CHANNEL channel ) ;
8678 //******************************************************************************
8679 /* Function:
8680  void PLIB_DMA_ChannelXChainToLower( DMA_MODULE_ID index,
8681  DMA_CHANNEL channel )
8682  Summary:
8683  Chains the specified channel to a channel lower in natural priority.
8684  Description:
8685  This function will chain the specified channel to a channel lower in
8686  natural priority. CH3 will be enabled by a CH4 transfer complete.
8687  Precondition:
8688  None.
8689  Parameters:
8690  channel - One of the possible DMA channels listed by DMA_CHANNEL
8691  Returns:
8692  None.
8693  Example:
8694  <code>
8695  PLIB_DMA_ChannelXChainToLower ( DMA_ID_0, DMA_CHANNEL_4 );
8696  </code>
8697  Remarks:
8698  This function implements an operation of the ChannelXChain feature.
8699  This feature may not be available on all devices. Please refer to the
8700  specific device data sheet to determine availability or use the
8701  PLIB_DMA_ExistsChannelXChain function in your application to automatically
8702  determine whether this feature is available.
8703 */
8704 
8705 void
8707  DMA_MODULE_ID index ,
8708  DMA_CHANNEL channel ) ;
8709 //******************************************************************************
8710 /* Function:
8711  void PLIB_DMA_ChannelXChainToHigher ( DMA_MODULE_ID index,
8712  DMA_CHANNEL channel )
8713  Summary:
8714  Chains the specified channel to a channel higher in natural priority.
8715  Description:
8716  This function will chain the specified channel to a channel higher in
8717  natural priority. CH5 will be enabled by a CH4 transfer complete.
8718  Precondition:
8719  None.
8720  Parameters:
8721  channel - One of the possible DMA channels listed by DMA_CHANNEL
8722  Returns:
8723  None.
8724  Example:
8725  <code>
8726  PLIB_DMA_ChannelXChainToHigher ( DMA_ID_0, DMA_CHANNEL_4 );
8727  </code>
8728  Remarks:
8729  This function implements an operation of the ChannelXChain feature.
8730  This feature may not be available on all devices. Please refer to the
8731  specific device data sheet to determine availability or use the
8732  PLIB_DMA_ExistsChannelXChain function in your application to automatically
8733  determine whether this feature is available.
8734 */
8735 
8736 void
8738  DMA_MODULE_ID index ,
8739  DMA_CHANNEL channel ) ;
8740 //******************************************************************************
8741 /* Function:
8742  void PLIB_DMA_ChannelXBusyActiveSet ( DMA_MODULE_ID index,
8743  DMA_CHANNEL channel )
8744  Summary:
8745  Sets the Busy bit to active.
8746  Description:
8747  This function sets the Busy bit to active, indicating the channel is active
8748  or has been enabled.
8749  Precondition:
8750  None.
8751  Parameters:
8752  channel - One of the possible DMA channels listed by DMA_CHANNEL
8753  Returns:
8754  None.
8755  Example:
8756  <code>
8757  PLIB_DMA_ChannelXBusyActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
8758  </code>
8759  Remarks:
8760  This function implements an operation of the ChannelXBusy feature.
8761  This feature may not be available on all devices. Please refer to the
8762  specific device data sheet to determine availability or use the
8763  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8764  determine whether this feature is available.
8765 */
8766 
8767 void
8769  DMA_MODULE_ID index ,
8770  DMA_CHANNEL channel ) ;
8771 //******************************************************************************
8772 /* Function:
8773  void PLIB_DMA_ChannelXBusyInActiveSet ( DMA_MODULE_ID index,
8774  DMA_CHANNEL channel )
8775  Summary:
8776  Sets the Busy bit to inactive.
8777  Description:
8778  This function sets the Busy bit to inactive, indicating the channel is inactive
8779  or has been disabled.
8780  Precondition:
8781  None.
8782  Parameters:
8783  channel - One of the possible DMA channels listed by DMA_CHANNEL
8784  Returns:
8785  None.
8786  Example:
8787  <code>
8788  PLIB_DMA_ChannelXBusyInActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
8789  </code>
8790  Remarks:
8791  This function implements an operation of the ChannelXBusy feature.
8792  This feature may not be available on all devices. Please refer to the
8793  specific device data sheet to determine availability or use the
8794  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8795  determine whether this feature is available.
8796 */
8797 
8798 void
8800  DMA_MODULE_ID index ,
8801  DMA_CHANNEL channel ) ;
8802 //******************************************************************************
8803 /* Function:
8804  bool PLIB_DMA_ChannelXBusyIsBusy ( DMA_MODULE_ID index,
8805  DMA_CHANNEL channel )
8806  Summary:
8807  Returns the busy status of the specified channel.
8808  Description:
8809  This function returns the busy status of the specified channel.
8810  Precondition:
8811  None.
8812  Parameters:
8813  channel - One of the possible DMA channels listed by DMA_CHANNEL
8814  Returns:
8815  - true - The channel is active or has been enabled
8816  - false - The channel is inactive or has been disabled
8817  Example:
8818  <code>
8819  bool chBusyStatus;
8820  chBusyStatus = PLIB_DMA_ChannelXBusyIsBusy ( DMA_ID_0, DMA_CHANNEL_4 );
8821  </code>
8822  Remarks:
8823  This function implements an operation of the ChannelXBusy feature.
8824  This feature may not be available on all devices. Please refer to the
8825  specific device data sheet to determine availability or use the
8826  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8827  determine whether this feature is available.
8828 */
8829 
8830 bool
8832  DMA_MODULE_ID index ,
8833  DMA_CHANNEL channel ) ;
8834 //******************************************************************************
8835 /* Function:
8836  void PLIB_DMA_ChannelXTransferDirectionSelect ( DMA_MODULE_ID index,
8837  DMA_CHANNEL channel,
8838  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection )
8839  Summary:
8840  Selects the data transfer direction of the specified channel.
8841  Description:
8842  This function selects the data transfer direction of the specified channel.
8843  Precondition:
8844  None.
8845  Parameters:
8846  channel - One of the possible DMA channels listed by DMA_CHANNEL
8847  chTransferDirection - The transfer direction indicated by DMA_CHANNEL_TRANSFER_DIRECTION
8848  Returns:
8849  None.
8850  Example:
8851  <code>
8852  PLIB_DMA_ChannelXTransferDirectionSelect (
8853  DMA_ID_0,
8854  DMA_CHANNEL_4,
8855  DMA_READ_FROM_MEMORY_WRITE_TO_PERIPHERAL );
8856  </code>
8857  Remarks:
8858  This feature is not available on all devices. Please refer to the specific
8859  device data sheet to determine availability.
8860 */
8861 
8862 void
8864  DMA_MODULE_ID index ,
8865  DMA_CHANNEL channel ,
8866  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection ) ;
8867 //******************************************************************************
8868 /* Function:
8869  DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet (
8870  DMA_MODULE_ID index,
8871  DMA_CHANNEL channel)
8872  Summary:
8873  Returns the data transfer direction of the specified channel.
8874  Description:
8875  This function returns the data transfer direction of the specified channel.
8876  Precondition:
8877  None.
8878  Parameters:
8879  channel - One of the possible DMA channels listed by DMA_CHANNEL
8880  Returns:
8881  - DMA_CHANNEL_TRANSFER_DIRECTION - The transfer direction indicated by the
8882  DMA_CHANNEL_TRANSFER_DIRECTION
8883  Example:
8884  <code>
8885  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection;
8886  chTransferDirection = PLIB_DMA_ChannelXTransferDirectionGet (
8887  DMA_ID_0,
8888  DMA_CHANNEL_4 );
8889  </code>
8890  Remarks:
8891  This feature is not available on all devices. Please refer to the specific
8892  device data sheet to determine availability.
8893 */
8894 
8895 DMA_CHANNEL_TRANSFER_DIRECTION
8897  DMA_MODULE_ID index ,
8898  DMA_CHANNEL channel ) ;
8899 //******************************************************************************
8900 /* Function:
8901  void PLIB_DMA_ChannelXStartAddressOffsetSet( DMA_MODULE_ID index,
8902  DMA_CHANNEL channel ,
8903  uint16_t address,
8904  DMA_ADDRESS_OFFSET_TYPE offset )
8905  Summary:
8906  Sets the primary/secondary start address (DPSRAM) offset to the value
8907  specified depending on the offset type specified for the specified channel.
8908  Description:
8909  This function sets the primary/secondary start address (DPSRAM) offset to the value
8910  specified depending on the offset type specified for the specified channel.
8911  Precondition:
8912  None.
8913  Parameters:
8914  channel - One of the possible DMA channels listed by DMA_CHANNEL
8915  address - The primary/secondary DPSRAM start address offset
8916  offset - The type of the address offset (primary/secondary)
8917  Returns:
8918  None.
8919  Example:
8920  <code>
8921  uint16_t address = 0x100;
8922  PLIB_DMA_ChannelXStartAddressOffsetSet ( DMA_ID_0,
8923  DMA_CHANNEL_4,
8924  address,
8925  DMA_ADDRESS_OFFSET_PRIMARY );
8926  </code>
8927  Remarks:
8928  This feature is not available on all devices. Please refer to the specific
8929  device data sheet to determine availability.
8930 */
8931 
8932 void
8934  DMA_MODULE_ID index ,
8935  DMA_CHANNEL channel ,
8936  uint16_t address ,
8937  DMA_ADDRESS_OFFSET_TYPE offset ) ;
8938 //******************************************************************************
8939 /* Function:
8940  uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet ( DMA_MODULE_ID index,
8941  DMA_CHANNEL channel,
8942  DMA_ADDRESS_OFFSET_TYPE offset)
8943  Summary:
8944  Gets the primary/secondary start address (DPSRAM) offset.
8945  Description:
8946  This function gets the primary/secondary start address (DPSRAM) offset.
8947  Precondition:
8948  None.
8949  Parameters:
8950  channel - One of the possible DMA channels listed by DMA_CHANNEL
8951  offset - The type of the address offset (primary/secondary)
8952  Returns:
8953  - uint16_t - The primary/secondary DPSRAM start address offset
8954  Example:
8955  <code>
8956  uint16_t addressOffsetA;
8957  addressOffsetA = PLIB_DMA_ChannelXStartAddressOffsetGet (
8958  DMA_ID_0,
8959  DMA_CHANNEL_4,
8960  address,
8961  DMA_ADDRESS_OFFSET_PRIMARY );
8962  </code>
8963  Remarks:
8964  This feature is not available on all devices. Please refer to the specific
8965  device data sheet to determine availability.
8966 */
8967 
8968 uint16_t
8970  DMA_MODULE_ID index ,
8971  DMA_CHANNEL channel ,
8972  DMA_ADDRESS_OFFSET_TYPE offset ) ;
8973 //******************************************************************************
8974 /* Function:
8975  void PLIB_DMA_ChannelXPeripheralAddressSet( DMA_MODULE_ID index,
8976  DMA_CHANNEL channel ,
8977  uint16_t peripheraladdress )
8978  Summary:
8979  Sets the peripheral address for the specified channel.
8980  Description:
8981  This function sets the peripheral address for the specified channel.
8982  Precondition:
8983  None.
8984  Parameters:
8985  channel - One of the possible DMA channels listed by DMA_CHANNEL
8986  peripheraladdress - The peripheral address for the specified channel
8987  Returns:
8988  None.
8989  Example:
8990  <code>
8991  uint16_t peripheraladdress = 0x100;
8992  PLIB_DMA_ChannelXPeripheralAddressSet ( DMA_ID_0,
8993  DMA_CHANNEL_4,
8994  peripheraladdress );
8995  </code>
8996  Remarks:
8997  This feature is not available on all devices. Please refer to the specific
8998  device data sheet to determine availability.
8999 */
9000 
9001 void
9003  DMA_MODULE_ID index ,
9004  DMA_CHANNEL channel ,
9005  uint16_t peripheraladdress ) ;
9006 //******************************************************************************
9007 /* Function:
9008  uint16_t PLIB_DMA_ChannelXPeripheralAddressGet( DMA_MODULE_ID index,
9009  DMA_CHANNEL channel )
9010  Summary:
9011  Gets the peripheral address configured for the specified channel.
9012  Description:
9013  This function gets the peripheral address configured for the specified channel.
9014  Precondition:
9015  None.
9016  Parameters:
9017  channel - One of the possible DMA channels listed by DMA_CHANNEL
9018  Returns:
9019  - uint16_t - The peripheral address configured for the specified channel
9020  Example:
9021  <code>
9022  uint16_t peripheraladdress;
9023  peripheraladdress = PLIB_DMA_ChannelXPeripheralAddressGet ( DMA_ID_0,
9024  DMA_CHANNEL_4 );
9025  </code>
9026  Remarks:
9027  This feature is not available on all devices. Please refer to the specific
9028  device data sheet to determine availability.
9029 */
9030 
9031 uint16_t
9033  DMA_MODULE_ID index ,
9034  DMA_CHANNEL channel ) ;
9035 //******************************************************************************
9036 /* Function:
9037  void PLIB_DMA_ChannelXTransferCountSet( DMA_MODULE_ID index,
9038  DMA_CHANNEL channel ,
9039  uint16_t transferCount )
9040  Summary:
9041  Sets the DMA data transfer count for the specified channel.
9042  Description:
9043  This function sets the DMA data transfer count for the specified channel.
9044  Precondition:
9045  None.
9046  Parameters:
9047  channel - One of the possible DMA channels listed by DMA_CHANNEL
9048  transferCount - The DMA transfer count for the channel
9049  Returns:
9050  None.
9051  Example:
9052  <code>
9053  uint16_t transferCount = 0x10;
9054  PLIB_DMA_ChannelXTransferCountSet ( DMA_ID_0,
9055  DMA_CHANNEL_4,
9056  transferCount );
9057  </code>
9058  Remarks:
9059  This feature is not available on all devices. Please refer to the specific
9060  device data sheet to determine availability.
9061 */
9062 
9063 void
9065  DMA_MODULE_ID index ,
9066  DMA_CHANNEL channel ,
9067  uint16_t transferCount ) ;
9068 //******************************************************************************
9069 /* Function:
9070  uint16_t PLIB_DMA_ChannelXTransferCountGet( DMA_MODULE_ID index,
9071  DMA_CHANNEL channel )
9072  Summary:
9073  Gets the DMA data transfer count that is programmed for the specified channel.
9074  Description:
9075  This function gets the DMA data transfer count that is programmed for the specified channel.
9076  Precondition:
9077  None.
9078  Parameters:
9079  channel - One of the possible DMA channels listed by DMA_CHANNEL
9080  Returns:
9081  - uint16_t - The DMA transfer count for the channel
9082  Example:
9083  <code>
9084  uint16_t transferCount;
9085  transferCount = PLIB_DMA_ChannelXTransferCountGet ( DMA_ID_0,
9086  DMA_CHANNEL_4 );
9087  </code>
9088  Remarks:
9089  This feature is not available on all devices. Please refer to the specific
9090  device data sheet to determine availability.
9091 */
9092 
9093 uint16_t
9095  DMA_MODULE_ID index ,
9096  DMA_CHANNEL channel ) ;
9097 //******************************************************************************
9098 /* Function:
9099  void PLIB_DMA_ChannelXSourceAddressModeSelect (
9100  DMA_MODULE_ID index,
9101  DMA_CHANNEL channel,
9102  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode )
9103  Summary:
9104  Sets the source address mode of the specified channel.
9105  Description:
9106  This function sets the source address mode of the specified channel.
9107  Precondition:
9108  None.
9109  Parameters:
9110  channel - One of the possible DMA channels listed by DMA_CHANNEL
9111  sourceAddressMode - One of the possible source addressing modes listed by
9112  DMA_SOURCE_ADDRESSING_MODE
9113  Returns:
9114  None.
9115  Example:
9116  <code>
9117  PLIB_DMA_ChannelXSourceAddressModeSelect (
9118  DMA_ID_0,
9119  DMA_CHANNEL_4,
9120  DMA_ADDRESSING_SOURCE_INCREMENT_BASED_ON_SIZE );
9121  </code>
9122  Remarks:
9123  This feature is not available on all devices. Please refer to the specific
9124  device data sheet to determine availability.
9125 */
9126 
9127 void
9129  DMA_MODULE_ID index ,
9130  DMA_CHANNEL channel ,
9131  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode ) ;
9132 //******************************************************************************
9133 /* Function:
9134  DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet (
9135  DMA_MODULE_ID index,
9136  DMA_CHANNEL channel )
9137  Summary:
9138  Gets the source address mode of the specified channel.
9139  Description:
9140  This function gets the source address mode of the specified channel.
9141  Precondition:
9142  None.
9143  Parameters:
9144  channel - One of the possible DMA channels listed by DMA_CHANNEL
9145  Returns:
9146  - DMA_SOURCE_ADDRESSING_MODE - One of the possible source addressing modes
9147  listed by DMA_SOURCE_ADDRESSING_MODE
9148  Example:
9149  <code>
9150  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode;
9151  sourceAddressMode = PLIB_DMA_ChannelXSourceAddressModeGet ( DMA_ID_0,
9152  DMA_CHANNEL_4 );
9153  </code>
9154  Remarks:
9155  This feature is not available on all devices. Please refer to the specific
9156  device data sheet to determine availability.
9157 */
9158 
9159 DMA_SOURCE_ADDRESSING_MODE
9161  DMA_MODULE_ID index ,
9162  DMA_CHANNEL channel ) ;
9163 //******************************************************************************
9164 /* Function:
9165  void PLIB_DMA_ChannelXDestinationAddressModeSelect (
9166  DMA_MODULE_ID index,
9167  DMA_CHANNEL channel,
9168  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode )
9169  Summary:
9170  Sets the source address mode of the specified channel.
9171  Description:
9172  This function Sets the source address mode of the specified channel.
9173  Precondition:
9174  None.
9175  Parameters:
9176  channel - One of the possible DMA channels listed by DMA_CHANNEL
9177  destinationAddressMode - One of the possible source addressing modes listed by
9178  DMA_DESTINATION_ADDRESSING_MODE
9179  Returns:
9180  None.
9181  Example:
9182  <code>
9183  PLIB_DMA_ChannelXDestinationAddressModeSelect (
9184  DMA_ID_0,
9185  DMA_CHANNEL_4,
9186  DMA_ADDRESSING_DESTINATION_INCREMENT_BASED_ON_SIZE );
9187  </code>
9188  Remarks:
9189  This feature is not available on all devices. Please refer to the specific
9190  device data sheet to determine availability.
9191 */
9192 
9193 void
9195  DMA_MODULE_ID index ,
9196  DMA_CHANNEL channel ,
9197  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode ) ;
9198 //******************************************************************************
9199 /* Function:
9200  DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet (
9201  DMA_MODULE_ID index,
9202  DMA_CHANNEL channel )
9203  Summary:
9204  Gets the source address mode of the specified channel.
9205  Description:
9206  This function gets the source address mode of the specified channel.
9207  Precondition:
9208  None.
9209  Parameters:
9210  channel - One of the possible DMA channels listed by DMA_CHANNEL
9211  Returns:
9212  - destinationAddressMode - One of the possible source addressing modes listed by
9213  DMA_DESTINATION_ADDRESSING_MODE
9214  Example:
9215  <code>
9216  DMA_SOURCE_ADDRESSING_MODE destinationAddressMode;
9217  destinationAddressMode = PLIB_DMA_ChannelXDestinationAddressModeGet (
9218  DMA_ID_0,
9219  DMA_CHANNEL_4 );
9220  </code>
9221  Remarks:
9222  This feature is not available on all devices. Please refer to the specific
9223  device data sheet to determine availability.
9224 */
9225 
9226 DMA_DESTINATION_ADDRESSING_MODE
9228  DMA_MODULE_ID index ,
9229  DMA_CHANNEL channel ) ;
9230 //******************************************************************************
9231 /* Function:
9232  void PLIB_DMA_ChannelXAddressModeSelect (
9233  DMA_MODULE_ID index,
9234  DMA_CHANNEL channel,
9235  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode )
9236  Summary:
9237  Sets the channel address mode.
9238  Description:
9239  This function sets the channel address mode.
9240  Precondition:
9241  None.
9242  Parameters:
9243  channel - One of the possible DMA channels listed by DMA_CHANNEL
9244  channelAddressMode - One of the possible channel addressing modes listed by
9245  DMA_CHANNEL_ADDRESSING_MODE
9246  Returns:
9247  None.
9248  Example:
9249  <code>
9250  PLIB_DMA_ChannelXAddressModeSelect (
9251  DMA_ID_0,
9252  DMA_CHANNEL_4,
9253  DMA_ADDRESSING_REGISTER_INDIRECT_WITH_POST_INCREMENT );
9254  </code>
9255  Remarks:
9256  This feature is not available on all devices. Please refer to the specific
9257  device data sheet to determine availability.
9258 */
9259 
9260 void
9262  DMA_MODULE_ID index ,
9263  DMA_CHANNEL channel ,
9264  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode ) ;
9265 //******************************************************************************
9266 /* Function:
9267  DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet (
9268  DMA_MODULE_ID index,
9269  DMA_CHANNEL channel )
9270  Summary:
9271  Gets the channel address mode.
9272  Description:
9273  This function gets the channel address mode.
9274  Precondition:
9275  None.
9276  Parameters:
9277  channel - One of the possible DMA channels listed by DMA_CHANNEL
9278  Returns:
9279  - channelAddressMode - One of the possible source addressing modes listed by
9280  DMA_CHANNEL_ADDRESSING_MODE
9281  Example:
9282  <code>
9283  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode;
9284  channelAddressMode = PLIB_DMA_ChannelXAddressModeGet ( DMA_ID_0,
9285  DMA_CHANNEL_4 );
9286  </code>
9287  Remarks:
9288  This feature is not available on all devices. Please refer to the specific
9289  device data sheet to determine availability.
9290 */
9291 
9292 DMA_CHANNEL_ADDRESSING_MODE
9294  DMA_MODULE_ID index ,
9295  DMA_CHANNEL channel ) ;
9296 // *****************************************************************************
9297 // *****************************************************************************
9298 // Section: DMA Channel Event Configuration functions
9299 // *****************************************************************************
9300 // *****************************************************************************
9301 //******************************************************************************
9302 /* Function:
9303  void PLIB_DMA_ChannelXTriggerEnable ( DMA_MODULE_ID index,
9304  DMA_CHANNEL channel,
9305  DMA_CHANNEL_TRIGGER_TYPE trigger )
9306  Summary:
9307  Enables the specified DMA channel trigger.
9308  Description:
9309  This function enables the specified DMA channel trigger.
9310  Precondition:
9311  None.
9312  Parameters:
9313  channel - One of the possible DMA channels listed by DMA_CHANNEL
9314  trigger - Type of trigger (transfer start/abort/pattern match abort)
9315  Returns:
9316  None.
9317  Example:
9318  <code>
9319  PLIB_DMA_ChannelXTriggerEnable ( DMA_ID_0,
9320  DMA_CHANNEL_4,
9321  DMA_CHANNEL_TRIGGER_TRANSFER_ABORT );
9322  </code>
9323  Remarks:
9324  This function implements an operation of the ChannelXTrigger feature.
9325  This feature may not be available on all devices. Please refer to the
9326  specific device data sheet to determine availability or use the
9327  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9328  determine whether this feature is available.
9329 */
9330 
9331 void
9333  DMA_MODULE_ID index ,
9334  DMA_CHANNEL channel ,
9335  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9336 //******************************************************************************
9337 /* Function:
9338  bool PLIB_DMA_ChannelXTriggerIsEnabled( DMA_MODULE_ID index,
9339  DMA_CHANNEL channel,
9340  DMA_CHANNEL_TRIGGER_TYPE trigger )
9341  Summary:
9342  Returns the enable status of the specified DMA transfer/abort trigger.
9343  Description:
9344  This function returns the enable status of the specified DMA transfer/abort trigger.
9345  Precondition:
9346  None.
9347  Parameters:
9348  channel - One of the possible DMA channels listed by DMA_CHANNEL
9349  trigger - Type of trigger (transfer start/abort/pattern match abort)
9350  Returns:
9351  - true - The specified trigger is enabled
9352  - false - The specified trigger is disabled
9353  Example:
9354  <code>
9355  bool startTriggerstatus;
9356  startTriggerstatus = PLIB_DMA_ChannelXTriggerIsEnabled (
9357  DMA_ID_0,
9358  DMA_CHANNEL_4,
9359  DMA_CHANNEL_TRIGGER_TRANSFER_START );
9360  </code>
9361  Remarks:
9362  This function implements an operation of the ChannelXTrigger feature.
9363  This feature may not be available on all devices. Please refer to the
9364  specific device data sheet to determine availability or use the
9365  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9366  determine whether this feature is available.
9367 */
9368 
9369 bool
9371  DMA_MODULE_ID index ,
9372  DMA_CHANNEL channel ,
9373  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9374 //******************************************************************************
9375 /* Function:
9376  void PLIB_DMA_ChannelXTriggerDisable ( DMA_MODULE_ID index,
9377  DMA_CHANNEL channel,
9378  DMA_CHANNEL_TRIGGER_TYPE trigger )
9379  Summary:
9380  Disables the DMA transfer abort via a matching interrupt (specified by the IRQ).
9381  Description:
9382  This function disables the DMA transfer abort via a matching interrupt
9383  (specified by the IRQ). The interrupt number IRQ is ignored and does not terminate
9384  a transfer.
9385  Precondition:
9386  None.
9387  Parameters:
9388  channel - One of the possible DMA channels listed by DMA_CHANNEL
9389  trigger - Type of trigger (transfer start/abort/pattern match abort)
9390  Returns:
9391  None.
9392  Example:
9393  <code>
9394  PLIB_DMA_ChannelXTriggerDisable ( DMA_ID_0,
9395  DMA_CHANNEL_4,
9396  DMA_CHANNEL_TRIGGER_PATTERN_MATCH_ABORT );
9397  </code>
9398  Remarks:
9399  This function implements an operation of the ChannelXTrigger feature.
9400  This feature may not be available on all devices. Please refer to the
9401  specific device data sheet to determine availability or use the
9402  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9403  determine whether this feature is available.
9404 */
9405 
9406 void
9408  DMA_MODULE_ID index ,
9409  DMA_CHANNEL channel ,
9410  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9411 //******************************************************************************
9412 /* Function:
9413  void PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_MODULE_ID index,
9414  DMA_CHANNEL channel)
9415  Summary:
9416  Gets the source number for the DMA channel interrupts.
9417  Description:
9418  This function returns the interrupt source number for the specified
9419  DMA channel.
9420  Precondition:
9421  None.
9422  Parameters:
9423  channel - One of the possible DMA channels listed by DMA_CHANNEL
9424  Returns:
9425  None.
9426  Example:
9427  <code>
9428  PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_ID_0,
9429  DMA_CHANNEL_4);
9430  </code>
9431  Remarks:
9432  This function implements an operation of the ChannelXTrigger feature.
9433  This feature may not be available on all devices. Please refer to the
9434  specific device data sheet to determine availability or use the
9435  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9436  determine whether this feature is available.
9437 */
9438 
9439 DMA_CHANNEL_INT_SOURCE
9441  DMA_MODULE_ID index ,
9442  DMA_CHANNEL channel ) ;
9443 //******************************************************************************
9444 /* Function:
9445  void PLIB_DMA_ChannelXStartIRQSet ( DMA_MODULE_ID index,
9446  DMA_CHANNEL channel,
9447  DMA_TRIGGER_SOURCE IRQnum )
9448  Summary:
9449  Sets the IRQ to initiate the DMA transfer on the specified channel.
9450  Description:
9451  This function sets the IRQ to initiate the DMA transfer on the specified channel.
9452  (IRQ to start the channel transfer.)
9453  Precondition:
9454  None.
9455  Parameters:
9456  channel - One of the possible DMA channels listed by DMA_CHANNEL
9457  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9458  Returns:
9459  None.
9460  Example:
9461  <code>
9462  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_OUTPUT_COMPARE_1;
9463  PLIB_DMA_ChannelXStartIRQSet ( DMA_ID_0,
9464  DMA_CHANNEL_4,
9465  irq );
9466  </code>
9467  Remarks:
9468  This function implements an operation of the ChannelXStartIRQ feature.
9469  This feature may not be available on all devices. Please refer to the
9470  specific device data sheet to determine availability or use the
9471  PLIB_DMA_ExistsChannelXStartIRQ function in your application to automatically
9472  determine whether this feature is available.
9473 */
9474 
9475 void
9477  DMA_MODULE_ID index ,
9478  DMA_CHANNEL channel ,
9479  DMA_TRIGGER_SOURCE IRQnum ) ;
9480 //******************************************************************************
9481 /* Function:
9482  void PLIB_DMA_ChannelXAbortIRQSet ( DMA_MODULE_ID index,
9483  DMA_CHANNEL channel,
9484  DMA_TRIGGER_SOURCE IRQ )
9485  Summary:
9486  Sets the IRQ to abort the DMA transfer on the specified channel.
9487  Description:
9488  This function sets the IRQ to abort the DMA transfer on the specified channel.
9489  (IRQ to start the channel transfer.)
9490  Precondition:
9491  None.
9492  Parameters:
9493  channel - One of the possible DMA channels listed by DMA_CHANNEL
9494  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9495  Returns:
9496  None.
9497  Example:
9498  <code>
9499  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_TIMER_CORE;
9500  PLIB_DMA_ChannelXAbortIRQSet ( DMA_ID_0,
9501  DMA_CHANNEL_4,
9502  irq );
9503  </code>
9504  Remarks:
9505  This function implements an operation of the ChannelXAbortIRQ feature.
9506  This feature may not be available on all devices. Please refer to the
9507  specific device data sheet to determine availability or use the
9508  PLIB_DMA_ExistsChannelXAbortIRQ function in your application to automatically
9509  determine whether this feature is available.
9510 */
9511 
9512 void
9514  DMA_MODULE_ID index ,
9515  DMA_CHANNEL channel ,
9516  DMA_TRIGGER_SOURCE IRQ ) ;
9517 //******************************************************************************
9518 /* Function:
9519  void PLIB_DMA_ChannelXDataSizeSelect ( DMA_MODULE_ID index,
9520  DMA_CHANNEL channel,
9521  DMA_CHANNEL_DATA_SIZE channelDataSize )
9522  Summary:
9523  Selects the data size for the specified channel.
9524  Description:
9525  This function selects the data size for the specified channel.
9526  Precondition:
9527  None.
9528  Parameters:
9529  channel - One of the possible DMA channels listed by DMA_CHANNEL
9530  channelDataSize - One of the possible data sizes listed by DMA_CHANNEL_DATA_SIZE
9531  Returns:
9532  None.
9533  Example:
9534  <code>
9535  DMA_CHANNEL_DATA_SIZE channelDataSize = DMA_CHANNEL_DATA_8;
9536  PLIB_DMA_ChannelXDataSizeSelect ( DMA_ID_0,
9537  DMA_CHANNEL_4,
9538  channelDataSize );
9539  </code>
9540  Remarks:
9541  This feature is not available on all devices. Please refer to the specific
9542  device data sheet to determine availability.
9543 */
9544 
9545 void
9547  DMA_MODULE_ID index ,
9548  DMA_CHANNEL channel ,
9549  DMA_CHANNEL_DATA_SIZE channelDataSize ) ;
9550 //******************************************************************************
9551 /* Function:
9552  DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet ( DMA_MODULE_ID index,
9553  DMA_CHANNEL channel )
9554  Summary:
9555  Returns the current data size for the specified channel.
9556  Description:
9557  This function returns the current data size for the specified channel.
9558  Precondition:
9559  None.
9560  Parameters:
9561  channel - One of the possible DMA channels listed by DMA_CHANNEL
9562  Returns:
9563  - channelDataSize - One of the possible data sizes listed by
9564  DMA_CHANNEL_DATA_SIZE
9565  Example:
9566  <code>
9567  DMA_CHANNEL_DATA_SIZE channelDataSize;
9568  channelDataSize = PLIB_DMA_ChannelXDataSizeGet( DMA_ID_0,
9569  DMA_CHANNEL_4 );
9570  </code>
9571  Remarks:
9572  This feature is not available on all devices. Please refer to the specific
9573  device data sheet to determine availability.
9574 */
9575 
9576 DMA_CHANNEL_DATA_SIZE
9578  DMA_MODULE_ID index ,
9579  DMA_CHANNEL channel ) ;
9580 //******************************************************************************
9581 /* Function:
9582  void PLIB_DMA_ChannelXOperatingTransferModeSelect (
9583  DMA_MODULE_ID index,
9584  DMA_CHANNEL channel,
9585  DMA_TRANSFER_MODE channeltransferMode )
9586  Summary:
9587  Selects the transfer/operating mode for the specified channel.
9588  Description:
9589  This function selects the transfer/operating mode for the specified channel.
9590  (Transfer mode and operating mode are used interchangeably.)
9591  Precondition:
9592  None.
9593  Parameters:
9594  channel - One of the possible DMA channels listed by DMA_CHANNEL
9595  channeltransferMode - One of the possible operating/transfer modes listed by
9596  DMA_TRANSFER_MODE
9597  Returns:
9598  None.
9599  Example:
9600  <code>
9601  DMA_TRANSFER_MODE channeltransferMode = DMA_MODE_REPEATED_CONTINUOUS;
9602  PLIB_DMA_ChannelXOperatingTransferModeSelect ( DMA_ID_0,
9603  DMA_CHANNEL_4,
9604  channeltransferMode );
9605  </code>
9606  Remarks:
9607  This feature is not available on all devices. Please refer to the specific
9608  device data sheet to determine availability.
9609 */
9610 
9611 void
9613  DMA_MODULE_ID index ,
9614  DMA_CHANNEL channel ,
9615  DMA_TRANSFER_MODE channeltransferMode ) ;
9616 //******************************************************************************
9617 /* Function:
9618  DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet (
9619  DMA_MODULE_ID index,
9620  DMA_CHANNEL channel )
9621  Summary:
9622  Returns the current transfer/operating mode for the specified channel.
9623  Description:
9624  This function returns the current transfer/operating mode for the specified channel.
9625  (Transfer mode and operating mode are used interchangeably.)
9626  Precondition:
9627  None.
9628  Parameters:
9629  channel - One of the possible DMA channels listed by DMA_CHANNEL
9630  Returns:
9631  - channeltransferMode - One of the possible operating/transfer modes listed
9632  by DMA_TRANSFER_MODE
9633  Example:
9634  <code>
9635  DMA_TRANSFER_MODE channeltransferMode;
9636  channeltransferMode = PLIB_DMA_ChannelXOperatingTransferModeGet (
9637  DMA_ID_0,
9638  DMA_CHANNEL_4 );
9639  </code>
9640  Remarks:
9641  This feature is not available on all devices. Please refer to the specific
9642  device data sheet to determine availability.
9643 */
9644 
9645 DMA_TRANSFER_MODE
9647  DMA_MODULE_ID index ,
9648  DMA_CHANNEL channel ) ;
9649 //******************************************************************************
9650 /* Function:
9651  void PLIB_DMA_ChannelXReloadEnable( DMA_MODULE_ID index,
9652  DMA_CHANNEL channel )
9653  Summary:
9654  Enables reloading of the address and count registers.
9655  Description:
9656  This function enables reloading of the address and count registers. The source,
9657  destination address, and the DMA count registers are reloaded to their previous
9658  values upon the start of the next operation.
9659  Precondition:
9660  None.
9661  Parameters:
9662  channel - One of the possible DMA channels listed by DMA_CHANNEL
9663  Returns:
9664  None.
9665  Example:
9666  <code>
9667  PLIB_DMA_ChannelXReloadEnable ( DMA_ID_0,
9668  DMA_CHANNEL_4 );
9669  </code>
9670  Remarks:
9671  This feature is not available on all devices. Please refer to the specific
9672  device data sheet to determine availability.
9673 */
9674 
9675 void
9677  DMA_MODULE_ID index ,
9678  DMA_CHANNEL channel ) ;
9679 //******************************************************************************
9680 /* Function:
9681  bool PLIB_DMA_ChannelXReloadIsEnabled ( DMA_MODULE_ID index,
9682  DMA_CHANNEL channel )
9683  Summary:
9684  Returns the address and count registers reload enable status.
9685  Description:
9686  This function returns the address and count registers reload enable status.
9687  Precondition:
9688  None.
9689  Parameters:
9690  channel - One of the possible DMA channels listed by DMA_CHANNEL
9691  Returns:
9692  - true - The address and count registers reload is enabled
9693  - false - The address and count registers reload is disabled
9694  Example:
9695  <code>
9696  bool chAddressCountReloadStatus;
9697  chAddressCountReloadStatus = PLIB_DMA_ChannelXReloadIsEnabled (
9698  DMA_ID_0,
9699  DMA_CHANNEL_4 );
9700  </code>
9701  Remarks:
9702  This feature is not available on all devices. Please refer to the specific
9703  device data sheet to determine availability.
9704 */
9705 
9706 bool
9708  DMA_MODULE_ID index ,
9709  DMA_CHANNEL channel ) ;
9710 //******************************************************************************
9711 /* Function:
9712  void PLIB_DMA_ChannelXReloadDisable ( DMA_MODULE_ID index,
9713  DMA_CHANNEL channel )
9714  Summary:
9715  Disables reloading of the address and count registers.
9716  Description:
9717  This function disables reloading of the address and count registers. The source, destination
9718  address, and the DMA count registers are not reloaded to their previous values upon
9719  the start of the next operation.
9720  Precondition:
9721  None.
9722  Parameters:
9723  channel - One of the possible DMA channels listed by DMA_CHANNEL
9724  Returns:
9725  None.
9726  Example:
9727  <code>
9728  PLIB_DMA_ChannelXReloadDisable ( DMA_ID_0,
9729  DMA_CHANNEL_4 );
9730  </code>
9731  Remarks:
9732  This feature is not available on all devices. Please refer to the specific
9733  device data sheet to determine availability.
9734 */
9735 
9736 void
9738  DMA_MODULE_ID index ,
9739  DMA_CHANNEL channel ) ;
9740 //******************************************************************************
9741 /* Function:
9742  void PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_MODULE_ID index,
9743  DMA_CHANNEL channel )
9744  Summary:
9745  Enables the Null Write mode.
9746  Description:
9747  This function enables the Null Write mode. A dummy write is initiated to the
9748  source address for every write to the destination address.
9749  Precondition:
9750  None.
9751  Parameters:
9752  channel - One of the possible DMA channels listed by DMA_CHANNEL
9753  Returns:
9754  None.
9755  Example:
9756  <code>
9757  PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_ID_0,
9758  DMA_CHANNEL_4 );
9759  </code>
9760  Remarks:
9761  This feature is not available on all devices. Please refer to the specific
9762  device data sheet to determine availability.
9763 */
9764 
9765 void
9767  DMA_MODULE_ID index ,
9768  DMA_CHANNEL channel ) ;
9769 //******************************************************************************
9770 /* Function:
9771  bool PLIB_DMA_ChannelXNullWriteModeIsEnabled ( DMA_MODULE_ID index,
9772  DMA_CHANNEL channel )
9773  Summary:
9774  Returns the enable status of the Null Write mode for the specified channel.
9775  Description:
9776  This function returns the enable status of the Null Write mode for the specified channel.
9777  Precondition:
9778  None.
9779  Parameters:
9780  channel - One of the possible DMA channels listed by DMA_CHANNEL
9781  Returns:
9782  - true - Null write mode is enabled for this channel
9783  - false - Null write mode is disabled for this channel
9784  Example:
9785  <code>
9786  bool chNullWriteStatus;
9787  chNullWriteStatus = PLIB_DMA_ChannelXNullWriteModeIsEnabled (
9788  DMA_ID_0,
9789  DMA_CHANNEL_4 );
9790  </code>
9791  Remarks:
9792  This feature is not available on all devices. Please refer to the specific
9793  device data sheet to determine availability.
9794 */
9795 
9796 bool
9798  DMA_MODULE_ID index ,
9799  DMA_CHANNEL channel ) ;
9800 //******************************************************************************
9801 /* Function:
9802  void PLIB_DMA_ChannelXNullWriteModeDisable( DMA_MODULE_ID index,
9803  DMA_CHANNEL channel )
9804  Summary:
9805  Disables the Null Write mode.
9806  Description:
9807  This function disables the Null Write mode. No dummy write is initiated.
9808  Precondition:
9809  None.
9810  Parameters:
9811  channel - One of the possible DMA channels listed by DMA_CHANNEL
9812  Returns:
9813  None.
9814  Example:
9815  <code>
9816  PLIB_DMA_ChannelXNullWriteModeDisable ( DMA_ID_0,
9817  DMA_CHANNEL_4 );
9818  </code>
9819  Remarks:
9820  This feature is not available on all devices. Please refer to the specific
9821  device data sheet to determine availability.
9822 */
9823 
9824 void
9826  DMA_MODULE_ID index ,
9827  DMA_CHANNEL channel ) ;
9828 // *****************************************************************************
9829 // *****************************************************************************
9830 // Section: DMA start/end functions
9831 // *****************************************************************************
9832 // *****************************************************************************
9833 //******************************************************************************
9834 /* Function:
9835  void PLIB_DMA_StartTransferSet ( DMA_MODULE_ID index,
9836  DMA_CHANNEL channel )
9837  Summary:
9838  Initiates transfer on the specified channel.
9839  Description:
9840  This function initiates transfer on the specified channel. This is a forced transfer
9841  controlled via software.
9842  Precondition:
9843  None.
9844  Parameters:
9845  channel - One of the possible DMA channels listed by DMA_CHANNEL
9846  Returns:
9847  None.
9848  Example:
9849  <code>
9850  PLIB_DMA_StartTransferSet ( DMA_ID_0,
9851  DMA_CHANNEL_4 );
9852  </code>
9853  Remarks:
9854  This function implements an operation of the StartTransfer feature.
9855  This feature may not be available on all devices. Please refer to the
9856  specific device data sheet to determine availability or use the
9857  PLIB_DMA_ExistsStartTransfer function in your application to automatically
9858  determine whether this feature is available.
9859 */
9860 
9861 void
9863  DMA_MODULE_ID index ,
9864  DMA_CHANNEL channel ) ;
9865 //******************************************************************************
9866 /* Function:
9867  void PLIB_DMA_AbortTransferSet ( DMA_MODULE_ID index,
9868  DMA_CHANNEL channel )
9869  Summary:
9870  Aborts transfer on the specified channel.
9871  Description:
9872  This function aborts transfer on the specified channel. This is a forced abort
9873  controlled via software.
9874  Precondition:
9875  None.
9876  Parameters:
9877  channel - One of the possible DMA channels listed by DMA_CHANNEL
9878  Returns:
9879  None.
9880  Example:
9881  <code>
9882  PLIB_DMA_AbortTransferSet ( DMA_ID_0,
9883  DMA_CHANNEL_4 );
9884  </code>
9885  Remarks:
9886  This function implements an operation of the AbortTransfer feature.
9887  This feature may not be available on all devices. Please refer to the
9888  specific device data sheet to determine availability or use the
9889  PLIB_DMA_ExistsAbortTransfer function in your application to automatically
9890  determine whether this feature is available.
9891 */
9892 
9893 void
9895  DMA_MODULE_ID index ,
9896  DMA_CHANNEL channel ) ;
9897 // *****************************************************************************
9898 // *****************************************************************************
9899 // Section: DMA General Configuration functions
9900 // *****************************************************************************
9901 // *****************************************************************************
9902 //******************************************************************************
9903 /* Function:
9904  void PLIB_DMA_BusyActiveSet ( DMA_MODULE_ID index )
9905  Summary:
9906  Sets the BUSY bit of the DMA controller.
9907  Description:
9908  This function sets the BUSY bit of the DMA controller. The DMA module is active.
9909  Precondition:
9910  None.
9911  Parameters:
9912  None.
9913  Returns:
9914  None.
9915  Example:
9916  <code>
9917  PLIB_DMA_BusyActiveSet( DMA_ID_0 );
9918  </code>
9919  Remarks:
9920  This function implements an operation of the Busy feature.
9921  This feature may not be available on all devices. Please refer to the
9922  specific device data sheet to determine availability or use the
9923  PLIB_DMA_ExistsBusy function in your application to automatically
9924  determine whether this feature is available.
9925 */
9926 
9927 void
9929  DMA_MODULE_ID index ) ;
9930 //******************************************************************************
9931 /* Function:
9932  void PLIB_DMA_BusyActiveReset ( DMA_MODULE_ID index )
9933  Summary:
9934  Resets the BUSY bit of the DMA controller.
9935  Description:
9936  This function resets the BUSY bit of the DMA controller. The DMA module is
9937  disabled and is not actively transferring data.
9938  Precondition:
9939  None.
9940  Parameters:
9941  None.
9942  Returns:
9943  None.
9944  Example:
9945  <code>
9946  PLIB_DMA_BusyActiveReset( DMA_ID_0 );
9947  </code>
9948  Remarks:
9949  This function implements an operation of the Busy feature.
9950  This feature may not be available on all devices. Please refer to the
9951  specific device data sheet to determine availability or use the
9952  PLIB_DMA_ExistsBusy function in your application to automatically
9953  determine whether this feature is available.
9954 */
9955 
9956 void
9958  DMA_MODULE_ID index ) ;
9959 //******************************************************************************
9960 /* Function:
9961  bool PLIB_DMA_IsBusy ( DMA_MODULE_ID index )
9962  Summary:
9963  Gets the BUSY bit of the DMA controller.
9964  Description:
9965  This function gets the BUSY bit of the DMA controller.
9966  Precondition:
9967  None.
9968  Parameters:
9969  None.
9970  Returns:
9971  - true - DMA module is active
9972  - false - DMA module is disabled and is not actively transferring data
9973  Example:
9974  <code>
9975  bool dmaBusyStatus;
9976  dmaBusyStatus = PLIB_DMA_IsBusy( DMA_ID_0 );
9977  </code>
9978  Remarks:
9979  This function implements an operation of the Busy feature.
9980  This feature may not be available on all devices. Please refer to the
9981  specific device data sheet to determine availability or use the
9982  PLIB_DMA_ExistsBusy function in your application to automatically
9983  determine whether this feature is available.
9984 */
9985 
9986 bool
9987  PLIB_DMA_IsBusy (
9988  DMA_MODULE_ID index ) ;
9989 //******************************************************************************
9990 /* Function:
9991  void PLIB_DMA_SuspendEnable ( DMA_MODULE_ID index )
9992  Summary:
9993  DMA transfers are suspended to allow uninterrupted access by the CPU to the data bus.
9994  Description:
9995  This function suspends the DMA transfers to allow uninterrupted access
9996  by the CPU to the data bus.
9997  Precondition:
9998  None.
9999  Parameters:
10000  None.
10001  Returns:
10002  None.
10003  Example:
10004  <code>
10005  PLIB_DMA_SuspendEnable( DMA_ID_0 );
10006  </code>
10007  Remarks:
10008  This function implements an operation of the Suspend feature.
10009  This feature may not be available on all devices. Please refer to the
10010  specific device data sheet to determine availability or use the
10011  PLIB_DMA_ExistsSuspend function in your application to automatically
10012  determine whether this feature is available.
10013 */
10014 
10015 void
10017  DMA_MODULE_ID index ) ;
10018 //******************************************************************************
10019 /* Function:
10020  void PLIB_DMA_SuspendDisable ( DMA_MODULE_ID index )
10021  Summary:
10022  DMA suspend is disabled and the DMA module operates normally.
10023  Description:
10024  This function disables the DMA suspend. The DMA module continues to operate
10025  normally.
10026  Precondition:
10027  None.
10028  Parameters:
10029  None.
10030  Returns:
10031  None.
10032  Example:
10033  <code>
10034  PLIB_DMA_SuspendDisable( DMA_ID_0 );
10035  </code>
10036  Remarks:
10037  This function implements an operation of the Suspend feature.
10038  This feature may not be available on all devices. Please refer to the
10039  specific device data sheet to determine availability or use the
10040  PLIB_DMA_ExistsSuspend function in your application to automatically
10041  determine whether this feature is available.
10042 */
10043 
10044 void
10046  DMA_MODULE_ID index ) ;
10047 //******************************************************************************
10048 /* Function:
10049  bool PLIB_DMA_SuspendIsEnabled ( DMA_MODULE_ID index )
10050  Summary:
10051  Returns the DMA suspend status.
10052  Description:
10053  This function returns the DMA suspend status.
10054  Precondition:
10055  None.
10056  Parameters:
10057  None.
10058  Returns:
10059  - true - The DMA transfers are suspended
10060  - false - The DMA operates normally
10061  Example:
10062  <code>
10063  bool dmaSuspendStatus;
10064  dmaSuspendStatus = PLIB_DMA_SuspendIsEnabled( DMA_ID_0 );
10065  </code>
10066  Remarks:
10067  This function implements an operation of the Suspend feature.
10068  This feature may not be available on all devices. Please refer to the
10069  specific device data sheet to determine availability or use the
10070  PLIB_DMA_ExistsSuspend function in your application to automatically
10071  determine whether this feature is available.
10072 */
10073 
10074 bool
10076  DMA_MODULE_ID index ) ;
10077 //******************************************************************************
10078 /* Function:
10079  void PLIB_DMA_StopInIdleEnable ( DMA_MODULE_ID index )
10080  Summary:
10081  DMA transfers are halted during Idle mode.
10082  Description:
10083  This function halts DMA transfers during Idle mode.
10084  Precondition:
10085  None.
10086  Parameters:
10087  None.
10088  Returns:
10089  None.
10090  Example:
10091  <code>
10092  PLIB_DMA_StopInIdleEnable( DMA_ID_0 );
10093  </code>
10094  Remarks:
10095  This function implements an operation of the StopInIdle feature.
10096  This feature may not be available on all devices. Please refer to the
10097  specific device data sheet to determine availability or use the
10098  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10099  determine whether this feature is available.
10100 */
10101 
10102 void
10104  DMA_MODULE_ID index ) ;
10105 //******************************************************************************
10106 /* Function:
10107  void PLIB_DMA_StopInIdleDisable ( DMA_MODULE_ID index )
10108  Summary:
10109  DMA transfers continue during Idle mode.
10110  Description:
10111  This function causes DMA transfers to continue during Idle mode.
10112  Precondition:
10113  None.
10114  Parameters:
10115  None.
10116  Returns:
10117  None.
10118  Example:
10119  <code>
10120  PLIB_DMA_StopInIdleDisable( DMA_ID_0 );
10121  </code>
10122  Remarks:
10123  This function implements an operation of the StopInIdle feature.
10124  This feature may not be available on all devices. Please refer to the
10125  specific device data sheet to determine availability or use the
10126  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10127  determine whether this feature is available.
10128 */
10129 
10130 void
10132  DMA_MODULE_ID index ) ;
10133 //******************************************************************************
10134 /* Function:
10135  void PLIB_DMA_Enable ( DMA_MODULE_ID index )
10136  Summary:
10137  DMA module is enabled.
10138  Description:
10139  This function enables the DMA module.
10140  Precondition:
10141  None.
10142  Parameters:
10143  None.
10144  Returns:
10145  None.
10146  Example:
10147  <code>
10148  PLIB_DMA_Enable( DMA_ID_0 );
10149  </code>
10150  Remarks:
10151  This function implements an operation of the EnableControl feature.
10152  This feature may not be available on all devices. Please refer to the
10153  specific device data sheet to determine availability or use the
10154  PLIB_DMA_ExistsEnableControl function in your application to automatically
10155  determine whether this feature is available.
10156 */
10157 
10158 void
10159  PLIB_DMA_Enable (
10160  DMA_MODULE_ID index ) ;
10161 //******************************************************************************
10162 /* Function:
10163  bool PLIB_DMA_IsEnabled ( DMA_MODULE_ID index )
10164  Summary:
10165  Returns the DMA module enable status.
10166  Description:
10167  This function returns the DMA module enable status.
10168  Precondition:
10169  None.
10170  Parameters:
10171  None.
10172  Returns:
10173  - true - The DMA is enabled
10174  - false - The DMA is disabled
10175  Example:
10176  <code>
10177  PLIB_DMA_IsEnabled( DMA_ID_0 );
10178  </code>
10179  Remarks:
10180  This function implements an operation of the EnableControl feature.
10181  This feature may not be available on all devices. Please refer to the
10182  specific device data sheet to determine availability or use the
10183  PLIB_DMA_ExistsEnableControl function in your application to automatically
10184  determine whether this feature is available.
10185 */
10186 
10187 bool
10189  DMA_MODULE_ID index ) ;
10190 //******************************************************************************
10191 /* Function:
10192  void PLIB_DMA_Disable ( DMA_MODULE_ID index )
10193  Summary:
10194  DMA module is disabled.
10195  Description:
10196  This function disables the DMA module.
10197  Precondition:
10198  None.
10199  Parameters:
10200  None.
10201  Returns:
10202  None.
10203  Example:
10204  <code>
10205  PLIB_DMA_Disable( DMA_ID_0 );
10206  </code>
10207  Remarks:
10208  This function implements an operation of the EnableControl feature.
10209  This feature may not be available on all devices. Please refer to the
10210  specific device data sheet to determine availability or use the
10211  PLIB_DMA_ExistsEnableControl function in your application to automatically
10212  determine whether this feature is available.
10213 */
10214 
10215 void
10217  DMA_MODULE_ID index ) ;
10218 // *****************************************************************************
10219 // *****************************************************************************
10220 // Section: DMA status functions
10221 // *****************************************************************************
10222 // *****************************************************************************
10223 //******************************************************************************
10224 /* Function:
10225  uint8_t PLIB_DMA_ChannelBitsGet ( DMA_MODULE_ID index )
10226  Summary:
10227  Returns the DMA channel bits.
10228  Description:
10229  This function returns the channel bits.
10230  Precondition:
10231  None.
10232  Parameters:
10233  None.
10234  Returns:
10235  - uint8_t - DMA channel bits
10236  Example:
10237  <code>
10238  uint8_t dmaChBits;
10239  dmaChBits = PLIB_DMA_ChannelBitsGet( DMA_ID_0 );
10240  </code>
10241  Remarks:
10242  This function implements an operation of the ChannelBits feature.
10243  This feature may not be available on all devices. Please refer to the
10244  specific device data sheet to determine availability or use the
10245  PLIB_DMA_ExistsChannelBits function in your application to automatically
10246  determine whether this feature is available.
10247 */
10248 
10249 uint8_t
10251  DMA_MODULE_ID index ) ;
10252 //******************************************************************************
10253 /* Function:
10254  bool PLIB_DMA_LastBusAccessIsRead ( DMA_MODULE_ID index )
10255  Summary:
10256  Returns true if the last DMA bus access was a read.
10257  Description:
10258  This function returns true if the last DMA bus access was a read.
10259  Precondition:
10260  None.
10261  Parameters:
10262  None.
10263  Returns:
10264  - true - The last bus access was a read
10265  - false - The last bus access was not a read
10266  Example:
10267  <code>
10268  bool dmaLastBusAccessType;
10269  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsRead( DMA_ID_0 );
10270  </code>
10271  Remarks:
10272  This function implements an operation of the LastBusAccess feature.
10273  This feature may not be available on all devices. Please refer to the
10274  specific device data sheet to determine availability or use the
10275  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10276  determine whether this feature is available.
10277 */
10278 
10279 bool
10281  DMA_MODULE_ID index ) ;
10282 //******************************************************************************
10283 /* Function:
10284  bool PLIB_DMA_LastBusAccessIsWrite ( DMA_MODULE_ID index )
10285  Summary:
10286  Returns true if the last DMA bus access was a write.
10287  Description:
10288  This function returns true if the last DMA bus access was a write operation.
10289  Precondition:
10290  None.
10291  Parameters:
10292  None.
10293  Returns:
10294  - true - The last bus access was a write operation
10295  - false - The last bus access was not a write operation
10296  Example:
10297  <code>
10298  bool dmaLastBusAccessType;
10299  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsWrite( DMA_ID_0 );
10300  </code>
10301  Remarks:
10302  This function implements an operation of the LastBusAccess feature.
10303  This feature may not be available on all devices. Please refer to the
10304  specific device data sheet to determine availability or use the
10305  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10306  determine whether this feature is available.
10307 */
10308 
10309 bool
10311  DMA_MODULE_ID index ) ;
10312 //******************************************************************************
10313 /* Function:
10314  uint32_t PLIB_DMA_RecentAddressAccessed ( DMA_MODULE_ID index )
10315  Summary:
10316  Returns the address of the most recent DMA access.
10317  Description:
10318  This function returns the address of the most recent DMA access.
10319  Precondition:
10320  None.
10321  Parameters:
10322  None.
10323  Returns:
10324  - uint32_t - The most recent address accessed by the DMA
10325  Example:
10326  <code>
10327  uint32_t dmaLastAddressAccessed;
10328  dmaLastAddressAccessed = PLIB_DMA_RecentAddressAccessed( DMA_ID_0 );
10329  </code>
10330  Remarks:
10331  This function implements an operation of the RecentAddress feature.
10332  This feature may not be available on all devices. Please refer to the
10333  specific device data sheet to determine availability or use the
10334  PLIB_DMA_ExistsRecentAddress function in your application to automatically
10335  determine whether this feature is available.
10336 */
10337 
10338 uint32_t
10340  DMA_MODULE_ID index ) ;
10341 // *****************************************************************************
10342 // *****************************************************************************
10343 // Section: DMA Module CRC Feature Interface Functions
10344 // *****************************************************************************
10345 // *****************************************************************************
10346 //******************************************************************************
10347 /* Function:
10348  void PLIB_DMA_CRCChannelSelect( DMA_MODULE_ID index,
10349  DMA_CHANNEL channel )
10350  Summary:
10351  Assigns the CRC to the specified DMA channel.
10352  Description:
10353  This function assigns the CRC feature to the specified channel.
10354  Precondition:
10355  None.
10356  Parameters:
10357  channel - One of the possible DMA channels listed by DMA_CHANNEL
10358  Returns:
10359  None.
10360  Example:
10361  <code>
10362  PLIB_DMA_CRCChannelSelect( DMA_ID_0,
10363  DMA_CHANNEL_5 );
10364  </code>
10365  Remarks:
10366  This function implements an operation of the CRCChannel feature.
10367  This feature may not be available on all devices. Please refer to the
10368  specific device data sheet to determine availability or use the
10369  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10370  determine whether this feature is available.
10371 */
10372 
10373 void
10375  DMA_MODULE_ID index ,
10376  DMA_CHANNEL channel ) ;
10377 //******************************************************************************
10378 /* Function:
10379  DMA_CHANNEL PLIB_DMA_CRCChannelGet ( DMA_MODULE_ID index )
10380  Summary:
10381  Returns the current DMA channel to which the CRC is assigned.
10382  Description:
10383  This function returns the current DMA channel to which the CRC is assigned.
10384  Precondition:
10385  None.
10386  Parameters:
10387  None.
10388  Returns:
10389  crcChannel - One of the possible DMA channels listed by DMA_CHANNEL
10390  Example:
10391  <code>
10392  DMA_CHANNEL crcChannel;
10393  crcChannel = PLIB_DMA_CRCChannelGet( DMA_ID_0 );
10394  </code>
10395  Remarks:
10396  This function implements an operation of the CRCChannel feature.
10397  This feature may not be available on all devices. Please refer to the
10398  specific device data sheet to determine availability or use the
10399  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10400  determine whether this feature is available.
10401 */
10402 
10403 DMA_CHANNEL
10405  DMA_MODULE_ID index ) ;
10406 //******************************************************************************
10407 /* Function:
10408  void PLIB_DMA_CRCTypeSet ( DMA_MODULE_ID index,
10409  DMA_CRC_TYPE CRCType )
10410  Summary:
10411  Selects the DMA module CRC feature type.
10412  Description:
10413  This function selects the DMA module CRC feature type. The CRC feature will
10414  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10415  checksum.
10416  Precondition:
10417  None.
10418  Parameters:
10419  CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE
10420  Returns:
10421  None.
10422  Example:
10423  <code>
10424  PLIB_DMA_CRCTypeSet(DMA_ID_0,
10425  DMA_CRC_IP_HEADER );
10426  </code>
10427  Remarks:
10428  This function implements an operation of the CRCType feature.
10429  This feature may not be available on all devices. Please refer to the
10430  specific device data sheet to determine availability or use the
10431  PLIB_DMA_ExistsCRCType function in your application to automatically
10432  determine whether this feature is available.
10433 */
10434 
10435 void
10437  DMA_MODULE_ID index ,
10438  DMA_CRC_TYPE CRCType ) ;
10439 //******************************************************************************
10440 /* Function:
10441  DMA_CRC_TYPE PLIB_DMA_CRCTypeGet ( DMA_MODULE_ID index )
10442  Summary:
10443  Gets the current DMA module CRC feature type.
10444  Description:
10445  This function gets the DMA module CRC feature type. The CRC feature will
10446  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10447  checksum.
10448  Precondition:
10449  None.
10450  Parameters:
10451  None.
10452  Returns:
10453  - CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE.
10454  Example:
10455  <code>
10456  DMA_CRC_TYPE CRCType;
10457  CRCType = PLIB_DMA_CRCTypeGet( DMA_ID_0 );
10458  </code>
10459  Remarks:
10460  This function implements an operation of the CRCType feature.
10461  This feature may not be available on all devices. Please refer to the
10462  specific device data sheet to determine availability or use the
10463  PLIB_DMA_ExistsCRCType function in your application to automatically
10464  determine whether this feature is available.
10465 */
10466 
10467 DMA_CRC_TYPE
10469  DMA_MODULE_ID index ) ;
10470 //******************************************************************************
10471 /* Function:
10472  void PLIB_DMA_CRCAppendModeEnable ( DMA_MODULE_ID index )
10473  Summary:
10474  Enables the CRC append mode.
10475  Description:
10476  This function enables the CRC append mode. The DMA transfers data from the source
10477  into the CRC, but not to the destination. When a block transfer completes, the
10478  DMA writes the calculated CRC value to the location specified by the CHxDSA register.
10479  Precondition:
10480  None.
10481  Parameters:
10482  None.
10483  Returns:
10484  None.
10485  Example:
10486  <code>
10487  PLIB_DMA_CRCAppendModeEnable( DMA_ID_0 );
10488  </code>
10489  Remarks:
10490  This function implements an operation of the CRCAppendMode feature.
10491  This feature may not be available on all devices. Please refer to the
10492  specific device data sheet to determine availability or use the
10493  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10494  determine whether this feature is available.
10495 */
10496 
10497 void
10499  DMA_MODULE_ID index ) ;
10500 //******************************************************************************
10501 /* Function:
10502  bool PLIB_DMA_CRCAppendModeIsEnabled ( DMA_MODULE_ID index )
10503  Summary:
10504  Gets the enable status of the CRC append mode.
10505  Description:
10506  This function gets the enable status of the CRC append mode.
10507  Precondition:
10508  None.
10509  Parameters:
10510  None.
10511  Returns:
10512  - true - CRC append mode is enabled
10513  - false - CRC append mode is disabled
10514  Example:
10515  <code>
10516  bool DMAcrcAppendMode;
10517  DMAcrcAppendMode = PLIB_DMA_CRCAppendModeIsEnabled( DMA_ID_0 );
10518  </code>
10519  Remarks:
10520  This function implements an operation of the CRCAppendMode feature.
10521  This feature may not be available on all devices. Please refer to the
10522  specific device data sheet to determine availability or use the
10523  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10524  determine whether this feature is available.
10525 */
10526 
10527 bool
10529  DMA_MODULE_ID index ) ;
10530 //******************************************************************************
10531 /* Function:
10532  void PLIB_DMA_CRCAppendModeDisable ( DMA_MODULE_ID index )
10533  Summary:
10534  Disables the CRC append mode.
10535  Description:
10536  This function disables the CRC append mode. The DMA transfers data from the
10537  source through the CRC obeying WBO (DMA_MODULE_ID index, write byte order)
10538  as it writes the data to the destination.
10539  Precondition:
10540  None.
10541  Parameters:
10542  None.
10543  Returns:
10544  None.
10545  Example:
10546  <code>
10547  PLIB_DMA_CRCAppendModeDisable( DMA_ID_0 );
10548  </code>
10549  Remarks:
10550  This function implements an operation of the CRCAppendMode feature.
10551  This feature may not be available on all devices. Please refer to the
10552  specific device data sheet to determine availability or use the
10553  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10554  determine whether this feature is available.
10555 */
10556 
10557 void
10559  DMA_MODULE_ID index ) ;
10560 //******************************************************************************
10561 /* Function:
10562  void PLIB_DMA_CRCEnable ( DMA_MODULE_ID index )
10563  Summary:
10564  Enables the DMA module CRC feature.
10565  Description:
10566  This function enables the DMA module CRC feature. The channel transfers are
10567  routed through the CRC.
10568  Precondition:
10569  None.
10570  Parameters:
10571  None.
10572  Returns:
10573  None.
10574  Example:
10575  <code>
10576  PLIB_DMA_CRCEnable( DMA_ID_0 );
10577  </code>
10578  Remarks:
10579  This function implements an operation of the CRC feature.
10580  This feature may not be available on all devices. Please refer to the
10581  specific device data sheet to determine availability or use the
10582  PLIB_DMA_ExistsCRC function in your application to automatically
10583  determine whether this feature is available.
10584 */
10585 
10586 void
10588  DMA_MODULE_ID index ) ;
10589 //******************************************************************************
10590 /* Function:
10591  bool PLIB_DMA_CRCIsEnabled ( DMA_MODULE_ID index )
10592  Summary:
10593  Gets the enable status of the CRC feature.
10594  Description:
10595  This function gets the enable status of the CRC feature.
10596  Precondition:
10597  None.
10598  Parameters:
10599  None.
10600  Returns:
10601  - true - The CRC feature is enabled
10602  - false - The CRC feature is disabled
10603  Example:
10604  <code>
10605  bool DMAcrcStatus;
10606  DMAcrcStatus = PLIB_DMA_CRCIsEnabled( DMA_ID_0 );
10607  </code>
10608  Remarks:
10609  This function implements an operation of the CRC feature.
10610  This feature may not be available on all devices. Please refer to the
10611  specific device data sheet to determine availability or use the
10612  PLIB_DMA_ExistsCRC function in your application to automatically
10613  determine whether this feature is available.
10614 */
10615 
10616 bool
10618  DMA_MODULE_ID index ) ;
10619 //******************************************************************************
10620 /* Function:
10621  void PLIB_DMA_CRCDisable ( DMA_MODULE_ID index )
10622  Summary:
10623  Disables the DMA module CRC feature.
10624  Description:
10625  This function disables the DMA module CRC feature. The channel transfers proceed
10626  normally.
10627  Precondition:
10628  None.
10629  Parameters:
10630  None.
10631  Returns:
10632  None.
10633  Example:
10634  <code>
10635  PLIB_DMA_CRCDisable( DMA_ID_0 );
10636  </code>
10637  Remarks:
10638  This function implements an operation of the CRC feature.
10639  This feature may not be available on all devices. Please refer to the
10640  specific device data sheet to determine availability or use the
10641  PLIB_DMA_ExistsCRC function in your application to automatically
10642  determine whether this feature is available.
10643 */
10644 
10645 void
10647  DMA_MODULE_ID index ) ;
10648 //******************************************************************************
10649 /* Function:
10650  void PLIB_DMA_CRCPolynomialLengthSet ( DMA_MODULE_ID index,
10651  uint8_t polyLength )
10652  Summary:
10653  Selects the polynomial length.
10654  Description:
10655  This function Selects the polynomial length.
10656  Precondition:
10657  None.
10658  Parameters:
10659  polyLength - Polynomial length
10660  Returns:
10661  None.
10662  Example:
10663  <code>
10664  uint8_t polyLength = 0x2;
10665  PLIB_DMA_CRCPolynomialLengthSet( DMA_ID_0, polyLength );
10666  </code>
10667  Remarks:
10668  This function implements an operation of the CRCPolynomialLength feature.
10669  This feature may not be available on all devices. Please refer to the
10670  specific device data sheet to determine availability or use the
10671  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
10672  determine whether this feature is available.
10673 */
10674 
10675 void
10677  DMA_MODULE_ID index ,
10678  uint8_t polyLength ) ;
10679 //******************************************************************************
10680 /* Function:
10681  uint8_t PLIB_DMA_CRCPolynomialLengthGet ( DMA_MODULE_ID index )
10682  Summary:
10683  Gets the current polynomial length.
10684  Description:
10685  This function gets the current polynomial length.
10686  Precondition:
10687  None.
10688  Parameters:
10689  None.
10690  Returns:
10691  - uint8_t - Polynomial length
10692  Example:
10693  <code>
10694  uint8_t polyLength;
10695  polyLength = PLIB_DMA_CRCPolynomialLengthGet( DMA_ID_0 );
10696  </code>
10697  Remarks:
10698  This function implements an operation of the CRCPolynomialLength feature.
10699  This feature may not be available on all devices. Please refer to the
10700  specific device data sheet to determine availability or use the
10701  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
10702  determine whether this feature is available.
10703 */
10704 
10705 uint8_t
10707  DMA_MODULE_ID index ) ;
10708 //******************************************************************************
10709 /* Function:
10710  void PLIB_DMA_CRCBitOrderSelect ( DMA_MODULE_ID index,
10711  DMA_CRC_BIT_ORDER bitOrder )
10712  Summary:
10713  Selects the bit order for checksum calculation.
10714  Description:
10715  This function selects the bit order for checksum calculation.
10716  Precondition:
10717  None.
10718  Parameters:
10719  bitOrder - Specifies the bit order for CRC calculation
10720  Returns:
10721  None.
10722  Example:
10723  <code>
10724  PLIB_DMA_CRCBitOrderSelect ( DMA_ID_0,DMA_CRC_BIT_ORDER_LSB );
10725  </code>
10726  Remarks:
10727  This function implements an operation of the CRCBitOrder feature.
10728  This feature may not be available on all devices. Please refer to the
10729  specific device data sheet to determine availability or use the
10730  PLIB_DMA_ExistsCRCBitOrder function in your application to automatically
10731  determine whether this feature is available.
10732 */
10733 
10734 void
10736  DMA_MODULE_ID index ,
10737  DMA_CRC_BIT_ORDER bitOrder ) ;
10738 //******************************************************************************
10739 /* Function:
10740  void PLIB_DMA_CRCWriteByteOrderAlter ( DMA_MODULE_ID index )
10741  Summary:
10742  The source data is written to the destination reordered as defined by the
10743  BYTO<1:0> bits.
10744  Description:
10745  This function enables byte order alteration as specified by the BYTO<1:0> bits.
10746  The source data is written to the destination reordered as defined by the
10747  BYTO<1:0> bits.
10748  Precondition:
10749  None.
10750  Parameters:
10751  None.
10752  Returns:
10753  None.
10754  Example:
10755  <code>
10756  PLIB_DMA_CRCWriteByteOrderAlter ( DMA_ID_0 );
10757  </code>
10758  Remarks:
10759  This function implements an operation of the CRCWriteByteOrder feature.
10760  This feature may not be available on all devices. Please refer to the
10761  specific device data sheet to determine availability or use the
10762  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
10763  determine whether this feature is available.
10764 */
10765 
10766 void
10768  DMA_MODULE_ID index ) ;
10769 //******************************************************************************
10770 /* Function:
10771  void PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_MODULE_ID index )
10772  Summary:
10773  The source data is written to the destination unaltered.
10774  Description:
10775  This function disables byte order alteration. The source data is written
10776  to the destination unaltered.
10777  Precondition:
10778  None.
10779  Parameters:
10780  None.
10781  Returns:
10782  None.
10783  Example:
10784  <code>
10785  PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_ID_0 );
10786  </code>
10787  Remarks:
10788  This function implements an operation of the CRCWriteByteOrder feature.
10789  This feature may not be available on all devices. Please refer to the
10790  specific device data sheet to determine availability or use the
10791  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
10792  determine whether this feature is available.
10793 */
10794 
10795 void
10797  DMA_MODULE_ID index ) ;
10798 //******************************************************************************
10799 /* Function:
10800  void PLIB_DMA_CRCByteOrderSelect ( DMA_MODULE_ID index,
10801  DMA_CRC_BYTE_ORDER byteOrder )
10802  Summary:
10803  Selects the byte order.
10804  Description:
10805  This function selects the byte order.
10806  Precondition:
10807  The WBO bit must be set to use this function.
10808  Parameters:
10809  byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
10810  Returns:
10811  None.
10812  Example:
10813  <code>
10814  PLIB_DMA_CRCByteOrderSelect ( DMA_ID_0,
10815  DMA_CRC_SWAP_HALF_WORD_ON_WORD_BOUNDARY );
10816  </code>
10817  Remarks:
10818  This function implements an operation of the CRCByteOrder feature.
10819  This feature may not be available on all devices. Please refer to the
10820  specific device data sheet to determine availability or use the
10821  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
10822  determine whether this feature is available.
10823 */
10824 
10825 void
10827  DMA_MODULE_ID index ,
10828  DMA_CRC_BYTE_ORDER byteOrder ) ;
10829 //******************************************************************************
10830 /* Function:
10831  DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet ( DMA_MODULE_ID index )
10832  Summary:
10833  Gets the current byte order selected by the DMA module CRC feature.
10834  Description:
10835  This function gets the current byte order selected by the DMA module CRC feature.
10836  Precondition:
10837  The WBO bit must be set to use this function.
10838  Parameters:
10839  None.
10840  Returns:
10841  - byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
10842  Example:
10843  <code>
10844  DMA_CRC_BYTE_ORDER byteOrder;
10845  byteOrder = PLIB_DMA_CRCByteOrderGet ( DMA_ID_0 );
10846  </code>
10847  Remarks:
10848  This function implements an operation of the CRCByteOrder feature.
10849  This feature may not be available on all devices. Please refer to the
10850  specific device data sheet to determine availability or use the
10851  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
10852  determine whether this feature is available.
10853 */
10854 
10855 DMA_CRC_BYTE_ORDER
10857  DMA_MODULE_ID index ) ;
10858 //******************************************************************************
10859 /* Function:
10860  uint32_t PLIB_DMA_CRCDataRead ( DMA_MODULE_ID index )
10861  Summary:
10862  Reads the contents of the DMA CRC data register.
10863  Description:
10864  This function reads the contents of the DMA CRC data register.
10865  Precondition:
10866  None.
10867  Parameters:
10868  None.
10869  Returns:
10870  - uint32_t - 32-bit CRC data
10871  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10872  device data sheet to determine availability.
10873  Example:
10874  <code>
10875  uint32_t DMACRCdata;
10876  DMACRCdata = PLIB_DMA_CRCDataRead ( DMA_ID_0 );
10877  </code>
10878  Remarks:
10879  This function implements an operation of the CRCData feature.
10880  This feature may not be available on all devices. Please refer to the
10881  specific device data sheet to determine availability or use the
10882  PLIB_DMA_ExistsCRCData function in your application to automatically
10883  determine whether this feature is available.
10884 */
10885 
10886 uint32_t
10888  DMA_MODULE_ID index ) ;
10889 //******************************************************************************
10890 /* Function:
10891  void PLIB_DMA_CRCDataWrite ( DMA_MODULE_ID index,
10892  uint32_t DMACRCdata )
10893  Summary:
10894  Writes the contents of the DMA CRC data register with the specified data.
10895  Description:
10896  This function writes the contents of the DMA CRC data register.
10897  Precondition:
10898  None.
10899  Parameters:
10900  - DMACRCdata - 32-bit CRC data
10901  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10902  device data sheet to determine availability.
10903  Returns:
10904  None.
10905  Example:
10906  <code>
10907  uint32_t DMACRCdata = 0x0E0E0E;
10908  PLIB_DMA_CRCDataWrite ( DMA_ID_0, DMACRCdata );
10909  </code>
10910  Remarks:
10911  This function implements an operation of the CRCData feature.
10912  This feature may not be available on all devices. Please refer to the
10913  specific device data sheet to determine availability or use the
10914  PLIB_DMA_ExistsCRCData function in your application to automatically
10915  determine whether this feature is available.
10916 */
10917 
10918 void
10920  DMA_MODULE_ID index ,
10921  uint32_t DMACRCdata ) ;
10922 //******************************************************************************
10923 /* Function:
10924  uint32_t PLIB_DMA_CRCXOREnableGet ( DMA_MODULE_ID index )
10925  Summary:
10926  Reads the CRC XOR register.
10927  Description:
10928  This function reads the CRC XOR register.
10929  Precondition:
10930  None.
10931  Parameters:
10932  None.
10933  Returns:
10934  - uint32_t - 32-bit CRC XOR enable mask data
10935  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10936  device data sheet to determine availability.
10937  Example:
10938  <code>
10939  uint32_t DMACRCXORdata;
10940  DMACRCXORdata = PLIB_DMA_CRCXOREnableGet ( DMA_ID_0 );
10941  </code>
10942  Remarks:
10943  This function implements an operation of the CRCXOREnable feature.
10944  This feature may not be available on all devices. Please refer to the
10945  specific device data sheet to determine availability or use the
10946  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
10947  determine whether this feature is available.
10948 */
10949 
10950 uint32_t
10952  DMA_MODULE_ID index ) ;
10953 //******************************************************************************
10954 /* Function:
10955  void PLIB_DMA_CRCXOREnableSet ( DMA_MODULE_ID index,
10956  uint32_t DMACRCXOREnableMask )
10957  Summary:
10958  Writes to the CRC XOR enable register as per the specified enable mask.
10959  Description:
10960  This function writes to the CRC XOR enable register as per the specified
10961  enable mask. Each enabled bit will be taken as input to the shift register.
10962  Precondition:
10963  None.
10964  Parameters:
10965  - DMACRCXOREnableMask - 32-bit CRC XOR enable mask data
10966  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10967  device data sheet to determine availability.
10968  Returns:
10969  None.
10970  Example:
10971  <code>
10972  uint32_t DMACRCXOREnableMask = 0x05EFFFFF;
10973  PLIB_DMA_CRCXOREnableSet ( DMA_ID_0, DMACRCXOREnableMask );
10974  </code>
10975  Remarks:
10976  This function implements an operation of the CRCXOREnable feature.
10977  This feature may not be available on all devices. Please refer to the
10978  specific device data sheet to determine availability or use the
10979  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
10980  determine whether this feature is available.
10981 */
10982 
10983 void
10985  DMA_MODULE_ID index ,
10986  uint32_t DMACRCXOREnableMask ) ;
10987 // *****************************************************************************
10988 // *****************************************************************************
10989 // Section: DMA Address control Interface functions
10990 // *****************************************************************************
10991 // *****************************************************************************
10992 //******************************************************************************
10993 /* Function:
10994  uint32_t PLIB_DMA_ChannelXSourceStartAddressGet ( DMA_MODULE_ID index,
10995  DMA_CHANNEL dmaChannel )
10996  Summary:
10997  Reads the source start address configured for the specified channel.
10998  Description:
10999  This function reads the source start address configured for the specified
11000  channel.
11001  Precondition:
11002  None.
11003  Parameters:
11004  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11005  Returns:
11006  - uint32_t - The source start address configured for this channel
11007  Example:
11008  <code>
11009  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11010  uint32_t SourceStartAddress;
11011  SourceStartAddress = PLIB_DMA_ChannelXSourceStartAddressGet(DMA_ID_0,
11012  spiDMAChannel );
11013  </code>
11014  Remarks:
11015  This function implements an operation of the ChannelXSourceStartAddress feature.
11016  This feature may not be available on all devices. Please refer to the
11017  specific device data sheet to determine availability or use the
11018  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11019  determine whether this feature is available.
11020 */
11021 
11022 uint32_t
11024  DMA_MODULE_ID index ,
11025  DMA_CHANNEL dmaChannel ) ;
11026 //******************************************************************************
11027 /* Function:
11028  void PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_MODULE_ID index,
11029  DMA_CHANNEL dmaChannel,
11030  uint32_t sourceStartAddress)
11031  Summary:
11032  Writes the specified source start address into the register
11033  corresponding to the specified channel.
11034  Description:
11035  This function writes the specified Source start address into the register
11036  corresponding to the specified channel.
11037  Precondition:
11038  None.
11039  Parameters:
11040  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11041  sourceStartAddress - The source start address
11042  Returns:
11043  None.
11044  Example:
11045  <code>
11046  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11047  uint32_t sourceStartAddress = 0x00FDEA00;
11048  PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_ID_0,
11049  spiDMAChannel,
11050  sourceStartAddress );
11051  </code>
11052  Remarks:
11053  This function implements an operation of the ChannelXSourceStartAddress feature.
11054  This feature may not be available on all devices. Please refer to the
11055  specific device data sheet to determine availability or use the
11056  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11057  determine whether this feature is available.
11058 */
11059 
11060 void
11062  DMA_MODULE_ID index ,
11063  DMA_CHANNEL dmaChannel ,
11064  uint32_t sourceStartAddress ) ;
11065 //******************************************************************************
11066 /* Function:
11067  uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet ( DMA_MODULE_ID index,
11068  DMA_CHANNEL dmaChannel )
11069  Summary:
11070  Reads the destination start address configured for the specified channel.
11071  Description:
11072  This function reads the destination start address configured for the specified
11073  channel.
11074  Precondition:
11075  None.
11076  Parameters:
11077  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11078  Returns:
11079  - uint32_t - The destination start address configured for this channel
11080  Example:
11081  <code>
11082  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11083  uint32_t DestinationStartAddress;
11084  DestinationStartAddress = PLIB_DMA_ChannelXDestinationStartAddressGet (
11085  DMA_ID_0,
11086  spiDMAChannel );
11087  </code>
11088  Remarks:
11089  This function implements an operation of the ChannelXDestinationStartAddress feature.
11090  This feature may not be available on all devices. Please refer to the
11091  specific device data sheet to determine availability or use the
11092  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11093  determine whether this feature is available.
11094 */
11095 
11096 uint32_t
11098  DMA_MODULE_ID index ,
11099  DMA_CHANNEL dmaChannel ) ;
11100 //******************************************************************************
11101 /* Function:
11102  void PLIB_DMA_ChannelXDestinationStartAddressSet (
11103  DMA_MODULE_ID index,
11104  DMA_CHANNEL dmaChannel,
11105  uint32_t destinationStartAddress)
11106  Summary:
11107  Writes the specified destination start address into the register corresponding to
11108  the specified channel.
11109  Description:
11110  This function writes the specified destination start address into the register
11111  corresponding to the specified channel.
11112  Precondition:
11113  None.
11114  Parameters:
11115  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11116  destinationStartAddress - The destination start address
11117  Returns:
11118  None.
11119  Example:
11120  <code>
11121  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11122  uint32_t destinationStartAddress = 0x00FDEA00;
11123  PLIB_DMA_ChannelXDestinationStartAddressSet( DMA_ID_0,
11124  spiDMAChannel,
11125  destinationStartAddress );
11126  </code>
11127  Remarks:
11128  This function implements an operation of the ChannelXDestinationStartAddress feature.
11129  This feature may not be available on all devices. Please refer to the
11130  specific device data sheet to determine availability or use the
11131  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11132  determine whether this feature is available.
11133 */
11134 
11135 void
11137  DMA_MODULE_ID index ,
11138  DMA_CHANNEL dmaChannel ,
11139  uint32_t destinationStartAddress ) ;
11140 // *****************************************************************************
11141 // *****************************************************************************
11142 // Section: DMA Data control Interface functions
11143 // *****************************************************************************
11144 // *****************************************************************************
11145 //******************************************************************************
11146 /* Function:
11147  uint16_t PLIB_DMA_ChannelXSourceSizeGet ( DMA_MODULE_ID index,
11148  DMA_CHANNEL dmaChannel )
11149  Summary:
11150  Reads the source size configured for the specified channel.
11151  Description:
11152  This function reads the source size configured for the specified
11153  channel.
11154  Precondition:
11155  None.
11156  Parameters:
11157  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11158  Returns:
11159  - uint16_t - The Source size configured (in bytes) for this channel.
11160  The source size (8-bit, 16-bit) is device-specific. Please refer to the specific
11161  device data sheet to determine availability.
11162  Example:
11163  <code>
11164  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11165  uint16_t sourceSize;
11166  sourceSize = PLIB_DMA_ChannelXSourceSizeGet ( DMA_ID_0,
11167  spiDMAChannel );
11168  </code>
11169  Remarks:
11170  This function implements an operation of the ChannelXSourceSize feature.
11171  This feature may not be available on all devices. Please refer to the
11172  specific device data sheet to determine availability or use the
11173  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11174  determine whether this feature is available.
11175 */
11176 
11177 uint16_t
11179  DMA_MODULE_ID index ,
11180  DMA_CHANNEL dmaChannel ) ;
11181 //******************************************************************************
11182 /* Function:
11183  void PLIB_DMA_ChannelXSourceSizeSet ( DMA_MODULE_ID index,
11184  DMA_CHANNEL dmaChannel,
11185  uint16_t sourceSize)
11186  Summary:
11187  Writes the specified source size into the register corresponding
11188  to the specified channel.
11189  Description:
11190  This function writes the specified source size into the register
11191  corresponding to the specified channel.
11192  Precondition:
11193  None.
11194  Parameters:
11195  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11196  sourceSize - The source size. The source size (8-bit, 16-bit) is
11197  device-specific. Please refer to the specific device data
11198  sheet to determine availability.
11199  Returns:
11200  None.
11201  Example:
11202  <code>
11203  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11204  uint16_t sourceSize = 0xA00;
11205  PLIB_DMA_ChannelXSourceSizeSet ( DMA_ID_0,
11206  spiDMAChannel,
11207  sourceSize );
11208  </code>
11209  Remarks:
11210  This function implements an operation of the ChannelXSourceSize feature.
11211  This feature may not be available on all devices. Please refer to the
11212  specific device data sheet to determine availability or use the
11213  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11214  determine whether this feature is available.
11215 */
11216 
11217 void
11219  DMA_MODULE_ID index ,
11220  DMA_CHANNEL dmaChannel ,
11221  uint16_t sourceSize ) ;
11222 //******************************************************************************
11223 /* Function:
11224  uint16_t PLIB_DMA_ChannelXDestinationSizeGet ( DMA_MODULE_ID index,
11225  DMA_CHANNEL dmaChannel )
11226  Summary:
11227  Reads the destination size configured for the specified channel.
11228  Description:
11229  This function reads the destination size configured for the specified
11230  channel.
11231  Precondition:
11232  None.
11233  Parameters:
11234  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11235  Returns:
11236  - uint16_t - The destination size configured (in bytes) for this channel.
11237  The destination size (8-bit, 16-bit) is device-specific. Please refer to the specific
11238  device data sheet to determine availability.
11239  Example:
11240  <code>
11241  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11242  uint16_t DestinationSize;
11243  DestinationSize = PLIB_DMA_ChannelXDestinationSizeGet ( DMA_ID_0,
11244  spiDMAChannel );
11245  </code>
11246  Remarks:
11247  This function implements an operation of the ChannelXDestinationSize feature.
11248  This feature may not be available on all devices. Please refer to the
11249  specific device data sheet to determine availability or use the
11250  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11251  determine whether this feature is available.
11252 */
11253 
11254 uint16_t
11256  DMA_MODULE_ID index ,
11257  DMA_CHANNEL dmaChannel ) ;
11258 //******************************************************************************
11259 /* Function:
11260  void PLIB_DMA_ChannelXDestinationSizeSet ( DMA_MODULE_ID index,
11261  DMA_CHANNEL dmaChannel,
11262  uint16_t destinationSize)
11263  Summary:
11264  Writes the specified destination size into the register corresponding
11265  to the specified channel.
11266  Description:
11267  This function writes the specified destination size into the register
11268  corresponding to the specified channel.
11269  Precondition:
11270  None.
11271  Parameters:
11272  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11273  destinationSize - The destination size. The destination size (8-bit, 16-bit)
11274  is device-specific. Please refer to the specific device
11275  data sheet to determine availability.)
11276  Returns:
11277  None.
11278  Example:
11279  <code>
11280  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11281  uint16_t destinationSize = 0xA00;
11282  PLIB_DMA_ChannelXDestinationSizeSet( DMA_ID_0, spiDMAChannel, destinationSize );
11283  </code>
11284  Remarks:
11285  This function implements an operation of the ChannelXDestinationSize feature.
11286  This feature may not be available on all devices. Please refer to the
11287  specific device data sheet to determine availability or use the
11288  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11289  determine whether this feature is available.
11290 */
11291 
11292 void
11294  DMA_MODULE_ID index ,
11295  DMA_CHANNEL dmaChannel ,
11296  uint16_t destinationSize ) ;
11297 //******************************************************************************
11298 /* Function:
11299  uint16_t PLIB_DMA_ChannelXSourcePointerGet ( DMA_MODULE_ID index,
11300  DMA_CHANNEL dmaChannel )
11301  Summary:
11302  Reads the current byte of the source being pointed to for the specified channel.
11303  Description:
11304  This function reads the current byte of the source being pointed to for the
11305  specified channel.
11306  Precondition:
11307  None.
11308  Parameters:
11309  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11310  Returns:
11311  - uint16_t - The source byte being pointed to for this channel.
11312  The source pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11313  device data sheet to determine availability.
11314  Example:
11315  <code>
11316  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11317  uint16_t sourcebyte;
11318  sourcebyte = PLIB_DMA_ChannelXSourcePointerGet ( DMA_ID_0, spiDMAChannel );
11319  </code>
11320  Remarks:
11321  This function implements an operation of the ChannelXSourcePointer feature.
11322  This feature may not be available on all devices. Please refer to the
11323  specific device data sheet to determine availability or use the
11324  PLIB_DMA_ExistsChannelXSourcePointer function in your application to automatically
11325  determine whether this feature is available.
11326 */
11327 
11328 uint16_t
11330  DMA_MODULE_ID index ,
11331  DMA_CHANNEL dmaChannel ) ;
11332 //******************************************************************************
11333 /* Function:
11334  uint16_t PLIB_DMA_ChannelXDestinationPointerGet ( DMA_MODULE_ID index,
11335  DMA_CHANNEL dmaChannel )
11336  Summary:
11337  Reads the current byte of the destination being pointed to for the specified channel.
11338  Description:
11339  This function reads the current byte of the destination being pointed to for the
11340  specified channel.
11341  Precondition:
11342  None.
11343  Parameters:
11344  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11345  Returns:
11346  - uint16_t - The destination byte being pointed to for this channel.
11347  The destination pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11348  device data sheet to determine availability.
11349  Example:
11350  <code>
11351  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11352  uint16_t destinationbyte;
11353  destinationbyte = PLIB_DMA_ChannelXDestinationPointerGet ( DMA_ID_0,
11354  spiDMAChannel );
11355  </code>
11356  Remarks:
11357  This function implements an operation of the ChannelXDestinationPointer feature.
11358  This feature may not be available on all devices. Please refer to the
11359  specific device data sheet to determine availability or use the
11360  PLIB_DMA_ExistsChannelXDestinationPointer function in your application to automatically
11361  determine whether this feature is available.
11362 */
11363 
11364 uint16_t
11366  DMA_MODULE_ID index ,
11367  DMA_CHANNEL dmaChannel ) ;
11368 //******************************************************************************
11369 /* Function:
11370  uint16_t PLIB_DMA_ChannelXCellSizeGet ( DMA_MODULE_ID index,
11371  DMA_CHANNEL dmaChannel )
11372  Summary:
11373  Reads the cell size (in bytes) configured for the specified channel.
11374  Description:
11375  This function reads the cell size (in bytes) configured for the specified
11376  channel.
11377  Precondition:
11378  None.
11379  Parameters:
11380  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11381  Returns:
11382  - uint16_t - The cell size configured (in bytes) for this channel
11383  The cell size (8-bit, 16-bit) is device-specific. Please refer to the specific
11384  device data sheet to determine availability.
11385  Example:
11386  <code>
11387  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11388  uint16_t cellSize;
11389  cellSize = PLIB_DMA_ChannelXCellSizeGet ( DMA_ID_0,
11390  spiDMAChannel );
11391  </code>
11392  Remarks:
11393  This function implements an operation of the ChannelXCellSize feature.
11394  This feature may not be available on all devices. Please refer to the
11395  specific device data sheet to determine availability or use the
11396  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11397  determine whether this feature is available.
11398 */
11399 
11400 uint16_t
11402  DMA_MODULE_ID index ,
11403  DMA_CHANNEL dmaChannel ) ;
11404 //******************************************************************************
11405 /* Function:
11406  void PLIB_DMA_ChannelXCellSizeSet ( DMA_MODULE_ID index,
11407  DMA_CHANNEL dmaChannel,
11408  uint16_t cellSize)
11409  Summary:
11410  Writes the specified cell size into the register corresponding
11411  to the specified channel.
11412  Description:
11413  This function writes the specified cell size into the register
11414  corresponding to the specified channel.
11415  Precondition:
11416  None.
11417  Parameters:
11418  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11419  cellSize - The cell size in bytes. The cell size (8-bit, 16-bit) is
11420  device-specific. Please refer to the specific device data
11421  sheet to determine availability.)
11422  Returns:
11423  None.
11424  Example:
11425  <code>
11426  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11427  uint16_t cellSize = 0x10;
11428  PLIB_DMA_ChannelXCellSizeSet ( DMA_ID_0, spiDMAChannel, cellSize );
11429  </code>
11430  Remarks:
11431  This function implements an operation of the ChannelXCellSize feature.
11432  This feature may not be available on all devices. Please refer to the
11433  specific device data sheet to determine availability or use the
11434  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11435  determine whether this feature is available.
11436 */
11437 
11438 void
11440  DMA_MODULE_ID index ,
11441  DMA_CHANNEL dmaChannel ,
11442  uint16_t CellSize ) ;
11443 //******************************************************************************
11444 /* Function:
11445  uint16_t PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_MODULE_ID index,
11446  DMA_CHANNEL dmaChannel )
11447  Summary:
11448  Returns the number of bytes transferred since the last event.
11449  Description:
11450  This function returns the number of bytes transferred since the last event.
11451  Precondition:
11452  None.
11453  Parameters:
11454  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11455  Returns:
11456  - uint16_t - The number of bytes transferred since the last event.
11457  The cell progress pointer (8-bit, 16-bit) is device-specific. Please refer to
11458  the specific device data sheet to determine availability.
11459  Example:
11460  <code>
11461  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11462  uint16_t CellProgress;
11463  CellProgress = PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_ID_0,
11464  spiDMAChannel );
11465  </code>
11466  Remarks:
11467  This function implements an operation of the ChannelXCellProgressPointer feature.
11468  This feature may not be available on all devices. Please refer to the
11469  specific device data sheet to determine availability or use the
11470  PLIB_DMA_ExistsChannelXCellProgressPointer function in your application to automatically
11471  determine whether this feature is available.
11472 */
11473 
11474 uint16_t
11476  DMA_MODULE_ID index ,
11477  DMA_CHANNEL dmaChannel ) ;
11478 //******************************************************************************
11479 /* Function:
11480  uint16_t PLIB_DMA_ChannelXPatternDataGet ( DMA_MODULE_ID index,
11481  DMA_CHANNEL dmaChannel )
11482  Summary:
11483  Returns the pattern matching (for DMA abort) data programmed for the specified
11484  channel.
11485  Description:
11486  This function returns pattern matching (for DMA abort) data programmed for
11487  the specified channel.
11488  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11489  the specific device data sheet to determine availability.)
11490  Precondition:
11491  None.
11492  Parameters:
11493  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11494  Returns:
11495  - uint16_t - The pattern matching data programmed for the current channel.
11496  The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11497  the specific device data sheet to determine availability.
11498  Example:
11499  <code>
11500  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11501  uint16_t patternData;
11502  patternData = PLIB_DMA_ChannelXPatternDataGet ( DMA_ID_0, spiDMAChannel );
11503  </code>
11504  Remarks:
11505  This function implements an operation of the ChannelXPatternData feature.
11506  This feature may not be available on all devices. Please refer to the
11507  specific device data sheet to determine availability or use the
11508  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11509  determine whether this feature is available.
11510 */
11511 
11512 uint16_t
11514  DMA_MODULE_ID index ,
11515  DMA_CHANNEL dmaChannel ) ;
11516 //******************************************************************************
11517 /* Function:
11518  void PLIB_DMA_ChannelXPatternDataSet ( DMA_MODULE_ID index,
11519  DMA_CHANNEL dmaChannel,
11520  uint16_t patternData)
11521  Summary:
11522  Writes the specified pattern matching data (for DMA abort) into the register
11523  corresponding to the specified channel.
11524  Description:
11525  This function writes the specified pattern matching data (for DMA abort) into the
11526  register corresponding to the specified channel.
11527  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11528  the specific device data sheet to determine availability.)
11529  Precondition:
11530  None.
11531  Parameters:
11532  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11533  patternData - The pattern matching DATA programmed for the current channel
11534  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11535  the specific device data sheet to determine availability.)
11536  Returns:
11537  None.
11538  Example:
11539  <code>
11540  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11541  uint16_t patternData = '\0';
11542  PLIB_DMA_ChannelXPatternDataSet ( DMA_ID_0, spiDMAChannel, patternData );
11543  </code>
11544  Remarks:
11545  This function implements an operation of the ChannelXPatternData feature.
11546  This feature may not be available on all devices. Please refer to the
11547  specific device data sheet to determine availability or use the
11548  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11549  determine whether this feature is available.
11550 */
11551 
11552 void
11554  DMA_MODULE_ID index ,
11555  DMA_CHANNEL dmaChannel ,
11556  uint16_t patternData ) ;
11557 // *****************************************************************************
11558 // *****************************************************************************
11559 // Section: DMA Interrupt Control Interface functions
11560 // *****************************************************************************
11561 // *****************************************************************************
11562 //******************************************************************************
11563 /* Function:
11564  bool PLIB_DMA_ChannelXINTSourceFlagGet ( DMA_MODULE_ID index,
11565  DMA_CHANNEL dmaChannel,
11566  DMA_INT_TYPE dmaINTSource )
11567  Summary:
11568  Returns the status of the interrupt flag of the specified DMA interrupt source
11569  for the specified channel.
11570  Description:
11571  This function returns the status of the interrupt flag of the specified DMA interrupt
11572  source for the specified channel.
11573  Precondition:
11574  None.
11575  Parameters:
11576  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11577  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11578  Returns:
11579  - true - The interrupt flag is set
11580  - false - The interrupt flag is not set
11581  Example:
11582  <code>
11583  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11584  bool AddressErrorINTStatus;
11585  AddressErrorINTStatus = PLIB_DMA_ChannelXINTSourceFlagGet (
11586  DMA_ID_0,
11587  spiDMAChannel,
11588  DMA_INT_ADDRESS_ERROR );
11589  </code>
11590  Remarks:
11591  This function implements an operation of the ChannelXINTSourceFlag feature.
11592  This feature may not be available on all devices. Please refer to the
11593  specific device data sheet to determine availability or use the
11594  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11595  determine whether this feature is available.
11596 */
11597 
11598 bool
11600  DMA_MODULE_ID index ,
11601  DMA_CHANNEL dmaChannel ,
11602  DMA_INT_TYPE dmaINTSource ) ;
11603 //******************************************************************************
11604 /* Function:
11605  void PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_MODULE_ID index,
11606  DMA_CHANNEL dmaChannel,
11607  DMA_INT_TYPE dmaINTSource )
11608  Summary:
11609  Sets the interrupt flag of the specified DMA interrupt source for the specified channel.
11610  Description:
11611  This function sets the interrupt flag of the specified DMA interrupt source for
11612  the specified channel.
11613  Precondition:
11614  None.
11615  Parameters:
11616  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11617  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11618  Returns:
11619  None.
11620  Example:
11621  <code>
11622  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11623  PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_ID_0,
11624  spiDMAChannel,
11625  DMA_INT_ADDRESS_ERROR );
11626  </code>
11627  Remarks:
11628  This function implements an operation of the ChannelXINTSourceFlag feature.
11629  This feature may not be available on all devices. Please refer to the
11630  specific device data sheet to determine availability or use the
11631  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11632  determine whether this feature is available.
11633 */
11634 
11635 void
11637  DMA_MODULE_ID index ,
11638  DMA_CHANNEL dmaChannel ,
11639  DMA_INT_TYPE dmaINTSource ) ;
11640 //******************************************************************************
11641 /* Function:
11642  void PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_MODULE_ID index,
11643  DMA_CHANNEL dmaChannel,
11644  DMA_INT_TYPE dmaINTSource )
11645  Summary:
11646  Clears the interrupt flag of the specified DMA interrupt source
11647  for the specified channel.
11648  Description:
11649  This function clears the interrupt flag of the specified DMA interrupt source
11650  for the specified channel.
11651  Precondition:
11652  None.
11653  Parameters:
11654  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11655  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11656  Returns:
11657  None.
11658  Example:
11659  <code>
11660  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11661  PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_ID_0,
11662  spiDMAChannel,
11663  DMA_INT_ADDRESS_ERROR );
11664  </code>
11665  Remarks:
11666  This function implements an operation of the ChannelXINTSourceFlag feature.
11667  This feature may not be available on all devices. Please refer to the
11668  specific device data sheet to determine availability or use the
11669  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11670  determine whether this feature is available.
11671 */
11672 
11673 void
11675  DMA_MODULE_ID index ,
11676  DMA_CHANNEL dmaChannel ,
11677  DMA_INT_TYPE dmaINTSource ) ;
11678 //******************************************************************************
11679 /* Function:
11680  void PLIB_DMA_ChannelXINTSourceEnable ( DMA_MODULE_ID index,
11681  DMA_CHANNEL dmaChannel,
11682  DMA_INT_TYPE dmaINTSource )
11683  Summary:
11684  Enables the specified interrupt source for the specified channel.
11685  Description:
11686  This function enables the specified interrupt source for the specified channel.
11687  Precondition:
11688  None.
11689  Parameters:
11690  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11691  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11692  Returns:
11693  None.
11694  Example:
11695  <code>
11696  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11697  PLIB_DMA_ChannelXINTSourceEnable ( DMA_ID_0,
11698  spiDMAChannel,
11699  DMA_INT_ADDRESS_ERROR );
11700  </code>
11701  Remarks:
11702  This function implements an operation of the ChannelXINTSource feature.
11703  This feature may not be available on all devices. Please refer to the
11704  specific device data sheet to determine availability or use the
11705  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11706  determine whether this feature is available.
11707 */
11708 
11709 void
11711  DMA_MODULE_ID index ,
11712  DMA_CHANNEL dmaChannel ,
11713  DMA_INT_TYPE dmaINTSource ) ;
11714 //******************************************************************************
11715 /* Function:
11716  void PLIB_DMA_ChannelXINTSourceDisable ( DMA_MODULE_ID index,
11717  DMA_CHANNEL dmaChannel,
11718  DMA_INT_TYPE dmaINTSource )
11719  Summary:
11720  Disables the specified interrupt source for the specified channel.
11721  Description:
11722  This function disables the specified interrupt source for the specified channel.
11723  Precondition:
11724  None.
11725  Parameters:
11726  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11727  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11728  Returns:
11729  None.
11730  Example:
11731  <code>
11732  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11733  PLIB_DMA_ChannelXINTSourceDisable ( DMA_ID_0,
11734  spiDMAChannel,
11735  DMA_INT_ADDRESS_ERROR );
11736  </code>
11737  Remarks:
11738  This function implements an operation of the ChannelXINTSource feature.
11739  This feature may not be available on all devices. Please refer to the
11740  specific device data sheet to determine availability or use the
11741  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11742  determine whether this feature is available.
11743 */
11744 
11745 void
11747  DMA_MODULE_ID index ,
11748  DMA_CHANNEL dmaChannel ,
11749  DMA_INT_TYPE dmaINTSource ) ;
11750 //******************************************************************************
11751 /* Function:
11752  bool PLIB_DMA_ChannelXINTSourceIsEnabled ( DMA_MODULE_ID index,
11753  DMA_CHANNEL dmaChannel,
11754  DMA_INT_TYPE dmaINTSource )
11755  Summary:
11756  Returns the enable status of the specified interrupt source for the specified channel.
11757  Description:
11758  This function returns the enable status of the specified interrupt source for the
11759  specified channel.
11760  Precondition:
11761  None.
11762  Parameters:
11763  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11764  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11765  Returns:
11766  - true - The interrupt is enabled
11767  - false - The interrupt is not enabled
11768  Example:
11769  <code>
11770  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11771  bool dmaINTSourceEnableStatus;
11772  dmaINTSourceEnableStatus = PLIB_DMA_ChannelXINTSourceIsEnabled (
11773  DMA_ID_0,
11774  spiDMAChannel,
11775  DMA_INT_ADDRESS_ERROR );
11776  </code>
11777  Remarks:
11778  This function implements an operation of the ChannelXINTSource feature.
11779  This feature may not be available on all devices. Please refer to the
11780  specific device data sheet to determine availability or use the
11781  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11782  determine whether this feature is available.
11783 */
11784 
11785 bool
11787  DMA_MODULE_ID index ,
11788  DMA_CHANNEL dmaChannel ,
11789  DMA_INT_TYPE dmaINTSource ) ;
11790 //******************************************************************************
11791 /* Function:
11792  void PLIB_DMA_ChannelXPatternLengthSet( DMA_MODULE_ID index,
11793  DMA_CHANNEL dmaChannel,DMA_PATTERN_LENGTH patternLen )
11794  Summary:
11795  Sets the pattern match length.
11796  Description:
11797  This function sets the length of the pattern match ignore to 1 or 2 bytes.
11798  Precondition:
11799  None.
11800  Parameters:
11801  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11802  patternLen - Length of pattern match (either 1 or 2)
11803  Returns:
11804  None.
11805  Example:
11806  <code>
11807  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11808  DMA_PATTERN_LENGTH patternLen;
11809  patternLen = DMA_PATTERN_MATCH_LENGTH_1BYTE;
11810  PLIB_DMA_ChannelXPatternLengthSet(DMA_ID_0, dmaChannel, patternLen);
11811  </code>
11812  Remarks:
11813  This function implements an operation of the ChannelXPatternLength feature.
11814  This feature may not be available on all devices. Please refer to the
11815  specific device data sheet to determine availability or use the
11816  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
11817  determine whether this feature is available.
11818 */
11819 
11820 void
11822  DMA_MODULE_ID index ,
11823  DMA_CHANNEL dmaChannel ,
11824  DMA_PATTERN_LENGTH patternLen ) ;
11825 //******************************************************************************
11826 /* Function:
11827  DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet( DMA_MODULE_ID index,
11828  DMA_CHANNEL dmaChannel);
11829  Summary:
11830  Returns the pattern match length.
11831  Description:
11832  This function returns the length of the byte matching the CHPIGN bits during a
11833  pattern match that may be ignored during the pattern match determination when
11834  the CHPIGNEN bit is set.
11835  Precondition:
11836  None.
11837  Parameters:
11838  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11839  Returns:
11840  - patternLen - Length of pattern match (either 1 or 2)
11841  Example:
11842  <code>
11843  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11844  DMA_PATTERN_LENGTH patternLen;
11845  patternLen = PLIB_DMA_ChannelXPatternLengthGet(DMA_ID_0, dmaChannel);
11846  </code>
11847  Remarks:
11848  This function implements an operation of the ChannelXPatternLength feature.
11849  This feature may not be available on all devices. Please refer to the
11850  specific device data sheet to determine availability or use the
11851  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
11852  determine whether this feature is available.
11853 */
11854 
11855 DMA_PATTERN_LENGTH
11857  DMA_MODULE_ID index ,
11858  DMA_CHANNEL dmaChannel ) ;
11859 //******************************************************************************
11860 /* Function:
11861  void PLIB_DMA_ChannelXPatternIgnoreByteEnable ( DMA_MODULE_ID index,
11862  DMA_CHANNEL channel );
11863  Summary:
11864  Enables the pattern match ignore byte.
11865  Description:
11866  This function enables the pattern match ignore byte.
11867  Precondition:
11868  None.
11869  Parameters:
11870  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11871  Returns:
11872  None.
11873  Example:
11874  <code>
11875  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11876  PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_ID_0, dmaChannel);
11877  </code>
11878  Remarks:
11879  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11880  This feature may not be available on all devices. Please refer to the
11881  specific device data sheet to determine availability or use the
11882  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11883  determine whether this feature is available.
11884 */
11885 
11886 void
11888  DMA_MODULE_ID index ,
11889  DMA_CHANNEL channel ) ;
11890 //******************************************************************************
11891 /* Function:
11892  bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled ( DMA_MODULE_ID index,
11893  DMA_CHANNEL channel );
11894  Summary:
11895  Returns the state of the pattern match ignore byte.
11896  Description:
11897  This function returns the state (enabled or disabled) of the pattern match
11898  ignore byte.
11899  Precondition:
11900  None.
11901  Parameters:
11902  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11903  Returns:
11904  - true - The pattern match ignore byte is enabled
11905  - false - The pattern match ignore byte is disabled
11906  Example:
11907  <code>
11908  bool patternIsEnabled;
11909  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11910  patternIsEnabled = PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_ID_0, dmaChannel);
11911  </code>
11912  Remarks:
11913  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11914  This feature may not be available on all devices. Please refer to the
11915  specific device data sheet to determine availability or use the
11916  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11917  determine whether this feature is available.
11918 */
11919 
11920 bool
11922  DMA_MODULE_ID index ,
11923  DMA_CHANNEL channel ) ;
11924 //******************************************************************************
11925 /* Function:
11926  void PLIB_DMA_ChannelXPatternIgnoreByteDisable ( DMA_MODULE_ID index,
11927  DMA_CHANNEL channel );
11928  Summary:
11929  Disables the pattern match ignore byte.
11930  Description:
11931  This function disables the pattern match ignore byte.
11932  Precondition:
11933  None.
11934  Parameters:
11935  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11936  Returns:
11937  None.
11938  Example:
11939  <code>
11940  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11941  PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_ID_0, dmaChannel);
11942  </code>
11943  Remarks:
11944  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11945  This feature may not be available on all devices. Please refer to the
11946  specific device data sheet to determine availability or use the
11947  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11948  determine whether this feature is available.
11949 */
11950 
11951 void
11953  DMA_MODULE_ID index ,
11954  DMA_CHANNEL channel ) ;
11955 //******************************************************************************
11956 /* Function:
11957  void PLIB_DMA_ChannelXPatternIgnoreSet (DMA_MODULE_ID index,
11958  DMA_CHANNEL channel, uint8_t pattern );
11959  Summary:
11960  Sets the pattern match ignore value.
11961  Description:
11962  This function sets the value of the pattern match ignore.
11963  Precondition:
11964  None.
11965  Parameters:
11966  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11967  pattern - Pattern match ignore value
11968  Returns:
11969  None.
11970  Example:
11971  <code>
11972  uint8_t patternMatch = 0x8;
11973  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11974  PLIB_DMA_ChannelXPatternIgnoreSet ( DMA_ID_0, dmaChannel,patternMatch);
11975  </code>
11976  Remarks:
11977  This function implements an operation of the ChannelXPatternIgnore feature.
11978  This feature may not be available on all devices. Please refer to the
11979  specific device data sheet to determine availability or use the
11980  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
11981  determine whether this feature is available.
11982 */
11983 
11984 void
11986  DMA_MODULE_ID index ,
11987  DMA_CHANNEL channel ,
11988  uint8_t pattern ) ;
11989 //******************************************************************************
11990 /* Function:
11991  uint8_t PLIB_DMA_ChannelXPatternIgnoreGet( DMA_MODULE_ID index,
11992  DMA_CHANNEL channel );
11993  Summary:
11994  Returns the pattern match ignore value.
11995  Description:
11996  This function returns the value of the pattern match ignore.
11997  Precondition:
11998  None.
11999  Parameters:
12000  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12001  Returns:
12002  - uint8_t - Pattern match ignore value
12003  Example:
12004  <code>
12005  uint8_t patternMatch;
12006  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12007  patternMatch = PLIB_DMA_ChannelXPatternIgnoreGet ( DMA_ID_0, dmaChannel);
12008  </code>
12009  Remarks:
12010  This function implements an operation of the ChannelXPatternIgnore feature.
12011  This feature may not be available on all devices. Please refer to the
12012  specific device data sheet to determine availability or use the
12013  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
12014  determine whether this feature is available.
12015 */
12016 
12017 uint8_t
12019  DMA_MODULE_ID index ,
12020  DMA_CHANNEL channel ) ;
12021 // *****************************************************************************
12022 // *****************************************************************************
12023 // Section: DMA Peripheral Library Exists API Routines
12024 // *****************************************************************************
12025 // *****************************************************************************
12026 /* The following functions indicate the existence of the features on the device.
12027 */
12028 //******************************************************************************
12029 /* Function : PLIB_DMA_ExistsBusy( DMA_MODULE_ID index )
12030  Summary:
12031  Identifies whether the Busy feature exists on the DMA module.
12032  Description:
12033  This function identifies whether the Busy feature is available on the
12034  DMA module.
12035  When this function returns true, these functions are supported on the device:
12036  - PLIB_DMA_BusyActiveSet
12037  - PLIB_DMA_BusyActiveReset
12038  - PLIB_DMA_IsBusy
12039  Preconditions:
12040  None.
12041  Parameters:
12042  index - Identifier for the device instance
12043  Returns:
12044  - true - The Busy feature is supported on the device
12045  - false - The Busy feature is not supported on the device
12046  Remarks:
12047  None.
12048 */
12049 
12050 bool
12052  DMA_MODULE_ID index ) ;
12053 //******************************************************************************
12054 /* Function : PLIB_DMA_ExistsSuspend( DMA_MODULE_ID index )
12055  Summary:
12056  Identifies whether the Suspend feature exists on the DMA module.
12057  Description:
12058  This function identifies whether the Suspend feature is available on the
12059  DMA module.
12060  When this function returns true, these functions are supported on the device:
12061  - PLIB_DMA_SuspendEnable
12062  - PLIB_DMA_SuspendDisable
12063  - PLIB_DMA_SuspendIsEnabled
12064  Preconditions:
12065  None.
12066  Parameters:
12067  index - Identifier for the device instance
12068  Returns:
12069  - true - The Suspend feature is supported on the device
12070  - false - The Suspend feature is not supported on the device
12071  Remarks:
12072  None.
12073 */
12074 
12075 bool
12077  DMA_MODULE_ID index ) ;
12078 //******************************************************************************
12079 /* Function : PLIB_DMA_ExistsStopInIdle( DMA_MODULE_ID index )
12080  Summary:
12081  Identifies whether the StopInIdle feature exists on the DMA module.
12082  Description:
12083  This function identifies whether the StopInIdle feature is available on the
12084  DMA module.
12085  When this function returns true, these functions are supported on the device:
12086  - PLIB_DMA_StopInIdleEnable
12087  - PLIB_DMA_StopInIdleDisable
12088  Preconditions:
12089  None.
12090  Parameters:
12091  index - Identifier for the device instance
12092  Returns:
12093  - true - The StopInIdle feature is supported on the device
12094  - false - The StopInIdle feature is not supported on the device
12095  Remarks:
12096  None.
12097 */
12098 
12099 bool
12101  DMA_MODULE_ID index ) ;
12102 //******************************************************************************
12103 /* Function : PLIB_DMA_ExistsEnableControl( DMA_MODULE_ID index )
12104  Summary:
12105  Identifies whether the EnableControl feature exists on the DMA module.
12106  Description:
12107  This function identifies whether the EnableControl feature is available on
12108  the DMA module.
12109  When this function returns true, these functions are supported on the device:
12110  - PLIB_DMA_Enable
12111  - PLIB_DMA_Disable
12112  - PLIB_DMA_IsEnabled
12113  Preconditions:
12114  None.
12115  Parameters:
12116  index - Identifier for the device instance
12117  Returns:
12118  - true - The EnableControl feature is supported on the device
12119  - false - The EnableControl feature is not supported on the device
12120  Remarks:
12121  None.
12122 */
12123 
12124 bool
12126  DMA_MODULE_ID index ) ;
12127 //******************************************************************************
12128 /* Function : PLIB_DMA_ExistsChannelBits( DMA_MODULE_ID index )
12129  Summary:
12130  Identifies whether the ChannelBits feature exists on the DMA module.
12131  Description:
12132  This function identifies whether the ChannelBits feature is available on the
12133  DMA module.
12134  When this function returns true, this function is supported on the device:
12135  - PLIB_DMA_ChannelBitsGet
12136  Preconditions:
12137  None.
12138  Parameters:
12139  index - Identifier for the device instance
12140  Returns:
12141  - true - The ChannelBits feature is supported on the device
12142  - false - The ChannelBits feature is not supported on the device
12143  Remarks:
12144  None.
12145 */
12146 
12147 bool
12149  DMA_MODULE_ID index ) ;
12150 //******************************************************************************
12151 /* Function : PLIB_DMA_ExistsLastBusAccess( DMA_MODULE_ID index )
12152  Summary:
12153  Identifies whether the LastBusAccess feature exists on the DMA module.
12154  Description:
12155  This function identifies whether the LastBusAccess feature is available on the
12156  DMA module.
12157  When this function returns true, these functions are supported on the device:
12158  - PLIB_DMA_LastBusAccessIsRead
12159  - PLIB_DMA_LastBusAccessIsWrite
12160  Preconditions:
12161  None.
12162  Parameters:
12163  index - Identifier for the device instance
12164  Returns:
12165  - true - The LastBusAccess feature is supported on the device
12166  - false - The LastBusAccess feature is not supported on the device
12167  Remarks:
12168  None.
12169 */
12170 
12171 bool
12173  DMA_MODULE_ID index ) ;
12174 //******************************************************************************
12175 /* Function : PLIB_DMA_ExistsRecentAddress( DMA_MODULE_ID index )
12176  Summary:
12177  Identifies whether the RecentAddress feature exists on the DMA module.
12178  Description:
12179  This function identifies whether the RecentAddress feature is available on
12180  the DMA module.
12181  When this function returns true, this function is supported on the device:
12182  - PLIB_DMA_RecentAddressAccessed
12183  Preconditions:
12184  None.
12185  Parameters:
12186  index - Identifier for the device instance
12187  Returns:
12188  - true - The RecentAddress feature is supported on the device
12189  - false - The RecentAddress feature is not supported on the device
12190  Remarks:
12191  None.
12192 */
12193 
12194 bool
12196  DMA_MODULE_ID index ) ;
12197 //******************************************************************************
12198 /* Function : PLIB_DMA_ExistsCRCChannel( DMA_MODULE_ID index )
12199  Summary:
12200  Identifies whether the CRCChannel feature exists on the DMA module.
12201  Description:
12202  This function identifies whether the CRCChannel feature is available on the
12203  DMA module.
12204  When this function returns true, these functions are supported on the device:
12205  - PLIB_DMA_CRCChannelSelect
12206  - PLIB_DMA_CRCChannelGet
12207  Preconditions:
12208  None.
12209  Parameters:
12210  index - Identifier for the device instance
12211  Returns:
12212  - true - The CRCChannel feature is supported on the device
12213  - false - The CRCChannel feature is not supported on the device
12214  Remarks:
12215  None.
12216 */
12217 
12218 bool
12220  DMA_MODULE_ID index ) ;
12221 //******************************************************************************
12222 /* Function : PLIB_DMA_ExistsCRCType( DMA_MODULE_ID index )
12223  Summary:
12224  Identifies whether the CRCType feature exists on the DMA module.
12225  Description:
12226  This function identifies whether the CRCType feature is available on the
12227  DMA module.
12228  When this function returns true, these functions are supported on the device:
12229  - PLIB_DMA_CRCTypeGet
12230  - PLIB_DMA_CRCTypeSet
12231  Preconditions:
12232  None.
12233  Parameters:
12234  index - Identifier for the device instance
12235  Returns:
12236  - true - The CRCType feature is supported on the device
12237  - false - The CRCType feature is not supported on the device
12238  Remarks:
12239  None.
12240 */
12241 
12242 bool
12244  DMA_MODULE_ID index ) ;
12245 //******************************************************************************
12246 /* Function : PLIB_DMA_ExistsCRCAppendMode( DMA_MODULE_ID index )
12247  Summary:
12248  Identifies whether the CRCAppendMode feature exists on the DMA module.
12249  Description:
12250  This function identifies whether the CRCAppendMode feature is available on
12251  the DMA module.
12252  When this function returns true, these functions are supported on the device:
12253  - PLIB_DMA_CRCAppendModeEnable
12254  - PLIB_DMA_CRCAppendModeDisable
12255  - PLIB_DMA_CRCAppendModeIsEnabled
12256  Preconditions:
12257  None.
12258  Parameters:
12259  index - Identifier for the device instance
12260  Returns:
12261  - true - The CRCAppendMode feature is supported on the device
12262  - false - The CRCAppendMode feature is not supported on the device
12263  Remarks:
12264  None.
12265 */
12266 
12267 bool
12269  DMA_MODULE_ID index ) ;
12270 //******************************************************************************
12271 /* Function : PLIB_DMA_ExistsCRC( DMA_MODULE_ID index )
12272  Summary:
12273  Identifies whether the CRC feature exists on the DMA module.
12274  Description:
12275  This function identifies whether the CRC feature is available on the DMA module.
12276  When this function returns true, these functions are supported on the device:
12277  - PLIB_DMA_CRCEnable
12278  - PLIB_DMA_CRCDisable
12279  - PLIB_DMA_CRCIsEnabled
12280  Preconditions:
12281  None.
12282  Parameters:
12283  index - Identifier for the device instance
12284  Returns:
12285  - true - The CRC feature is supported on the device
12286  - false - The CRC feature is not supported on the device
12287  Remarks:
12288  None.
12289 */
12290 
12291 bool
12293  DMA_MODULE_ID index ) ;
12294 //******************************************************************************
12295 /* Function : PLIB_DMA_ExistsCRCPolynomialLength( DMA_MODULE_ID index )
12296  Summary:
12297  Identifies whether the CRCPolynomialLength feature exists on the DMA module.
12298  Description:
12299  This function identifies whether the CRCPolynomialLength feature is available
12300  on the DMA module.
12301  When this function returns true, these functions are supported on the device:
12302  - PLIB_DMA_CRCPolynomialLengthSet
12303  - PLIB_DMA_CRCPolynomialLengthGet
12304  Preconditions:
12305  None.
12306  Parameters:
12307  index - Identifier for the device instance
12308  Returns:
12309  - true - The CRCPolynomialLength feature is supported on the device
12310  - false - The CRCPolynomialLength feature is not supported on the device
12311  Remarks:
12312  None.
12313 */
12314 
12315 bool
12317  DMA_MODULE_ID index ) ;
12318 //******************************************************************************
12319 /* Function : PLIB_DMA_ExistsCRCBitOrder( DMA_MODULE_ID index )
12320  Summary:
12321  Identifies whether the CRCBitOrder feature exists on the DMA module.
12322  Description:
12323  This function identifies whether the CRCBitOrder feature is available on the
12324  DMA module.
12325  When this function returns true, this function is supported on the device:
12326  - PLIB_DMA_CRCBitOrderSelect
12327  Preconditions:
12328  None.
12329  Parameters:
12330  index - Identifier for the device instance
12331  Returns:
12332  - true - The CRCBitOrder feature is supported on the device
12333  - false - The CRCBitOrder feature is not supported on the device
12334  Remarks:
12335  None.
12336 */
12337 
12338 bool
12340  DMA_MODULE_ID index ) ;
12341 //******************************************************************************
12342 /* Function : PLIB_DMA_ExistsCRCWriteByteOrder( DMA_MODULE_ID index )
12343  Summary:
12344  Identifies whether the CRCWriteByteOrder feature exists on the DMA module.
12345  Description:
12346  This function identifies whether the CRCWriteByteOrder feature is available
12347  on the DMA module.
12348  When this function returns true, these functions are supported on the device:
12349  - PLIB_DMA_CRCWriteByteOrderAlter
12350  - PLIB_DMA_CRCWriteByteOrderMaintain
12351  Preconditions:
12352  None.
12353  Parameters:
12354  index - Identifier for the device instance
12355  Returns:
12356  - true - The CRCWriteByteOrder feature is supported on the device
12357  - false - The CRCWriteByteOrder feature is not supported on the device
12358  Remarks:
12359  None.
12360 */
12361 
12362 bool
12364  DMA_MODULE_ID index ) ;
12365 //******************************************************************************
12366 /* Function : PLIB_DMA_ExistsCRCByteOrder( DMA_MODULE_ID index )
12367  Summary:
12368  Identifies whether the CRCByteOrder feature exists on the DMA module.
12369  Description:
12370  This function identifies whether the CRCByteOrder feature is available on
12371  the DMA module.
12372  When this function returns true, these functions are supported on the device:
12373  - PLIB_DMA_CRCByteOrderSelect
12374  - PLIB_DMA_CRCByteOrderGet
12375  Preconditions:
12376  None.
12377  Parameters:
12378  index - Identifier for the device instance
12379  Returns:
12380  - true - The CRCByteOrder feature is supported on the device
12381  - false - The CRCByteOrder feature is not supported on the device
12382  Remarks:
12383  None.
12384 */
12385 
12386 bool
12388  DMA_MODULE_ID index ) ;
12389 //******************************************************************************
12390 /* Function : PLIB_DMA_ExistsCRCData( DMA_MODULE_ID index )
12391  Summary:
12392  Identifies whether the CRCData feature exists on the DMA module.
12393  Description:
12394  This function identifies whether the CRCData feature is available on the
12395  DMA module.
12396  When this function returns true, these functions are supported on the device:
12397  - PLIB_DMA_CRCDataRead
12398  - PLIB_DMA_CRCDataWrite
12399  Preconditions:
12400  None.
12401  Parameters:
12402  index - Identifier for the device instance
12403  Returns:
12404  - true - The CRCData feature is supported on the device
12405  - false - The CRCData feature is not supported on the device
12406  Remarks:
12407  None.
12408 */
12409 
12410 bool
12412  DMA_MODULE_ID index ) ;
12413 //******************************************************************************
12414 /* Function : PLIB_DMA_ExistsCRCXOREnable( DMA_MODULE_ID index )
12415  Summary:
12416  Identifies whether the CRCXOREnable feature exists on the DMA module.
12417  Description:
12418  This function identifies whether the CRCXOREnable feature is available on the
12419  DMA module.
12420  When this function returns true, these functions are supported on the device:
12421  - PLIB_DMA_CRCXOREnableSet
12422  - PLIB_DMA_CRCXOREnableGet
12423  Preconditions:
12424  None.
12425  Parameters:
12426  index - Identifier for the device instance
12427  Returns:
12428  - true - The CRCXOREnable feature is supported on the device
12429  - false - The CRCXOREnable feature is not supported on the device
12430  Remarks:
12431  None.
12432 */
12433 
12434 bool
12436  DMA_MODULE_ID index ) ;
12437 //******************************************************************************
12438 /* Function : PLIB_DMA_ExistsChannelXPriority( DMA_MODULE_ID index )
12439  Summary:
12440  Identifies whether the ChannelXPriority feature exists on the DMA module.
12441  Description:
12442  This function identifies whether the ChannelXPriority feature is available on
12443  the DMA module.
12444  When this function returns true, these functions are supported on the device:
12445  - PLIB_DMA_ChannelXPrioritySelect
12446  - PLIB_DMA_ChannelXPriorityGet
12447  Preconditions:
12448  None.
12449  Parameters:
12450  index - Identifier for the device instance
12451  Returns:
12452  - true - The ChannelXPriority feature is supported on the device
12453  - false - The ChannelXPriority feature is not supported on the device
12454  Remarks:
12455  None.
12456 */
12457 
12458 bool
12460  DMA_MODULE_ID index ) ;
12461 //******************************************************************************
12462 /* Function : PLIB_DMA_ExistsChannelXEvent( DMA_MODULE_ID index )
12463  Summary:
12464  Identifies whether the ChannelXEvent feature exists on the DMA module.
12465  Description:
12466  This function identifies whether the ChannelXEvent feature is available on
12467  the DMA module.
12468  When this function returns true, this function is supported on the device:
12469  - PLIB_DMA_ChannelXEventIsDetected
12470  Preconditions:
12471  None.
12472  Parameters:
12473  index - Identifier for the device instance
12474  Returns:
12475  - true - The ChannelXEvent feature is supported on the device
12476  - false - The ChannelXEvent feature is not supported on the device
12477  Remarks:
12478  None.
12479 */
12480 
12481 bool
12483  DMA_MODULE_ID index ) ;
12484 //******************************************************************************
12485 /* Function : PLIB_DMA_ExistsChannelXAuto( DMA_MODULE_ID index )
12486  Summary:
12487  Identifies whether the ChannelXAuto feature exists on the DMA module.
12488  Description:
12489  This function identifies whether the ChannelXAuto feature is available on
12490  the DMA module.
12491  When this function returns true, these functions are supported on the device:
12492  - PLIB_DMA_ChannelXAutoEnable
12493  - PLIB_DMA_ChannelXAutoDisable
12494  - PLIB_DMA_ChannelXAutoIsEnabled
12495  Preconditions:
12496  None.
12497  Parameters:
12498  index - Identifier for the device instance
12499  Returns:
12500  - true - The ChannelXAuto feature is supported on the device
12501  - false - The ChannelXAuto feature is not supported on the device
12502  Remarks:
12503  None.
12504 */
12505 
12506 bool
12508  DMA_MODULE_ID index ) ;
12509 //******************************************************************************
12510 /* Function : PLIB_DMA_ExistsChannelXChainEnbl( DMA_MODULE_ID index )
12511  Summary:
12512  Identifies whether the ChannelXChainEnbl feature exists on the DMA module.
12513  Description:
12514  This function identifies whether the ChannelXChainEnbl feature is available
12515  on the DMA module.
12516  When this function returns true, these functions are supported on the device:
12517  - PLIB_DMA_ChannelXChainEnable
12518  - PLIB_DMA_ChannelXChainDisable
12519  - PLIB_DMA_ChannelXChainIsEnabled
12520  Preconditions:
12521  None.
12522  Parameters:
12523  index - Identifier for the device instance
12524  Returns:
12525  - true - The ChannelXChainEnbl feature is supported on the device
12526  - false - The ChannelXChainEnbl feature is not supported on the device
12527  Remarks:
12528  None.
12529 */
12530 
12531 bool
12533  DMA_MODULE_ID index ) ;
12534 //******************************************************************************
12535 /* Function : PLIB_DMA_ExistsChannelXDisabled( DMA_MODULE_ID index )
12536  Summary:
12537  Identifies whether the ChannelXDisabled feature exists on the DMA module.
12538  Description:
12539  This function identifies whether the ChannelXDisabled feature is available
12540  on the DMA module.
12541  When this function returns true, these functions are supported on the device:
12542  - PLIB_DMA_ChannelXDisabledEnablesEvents
12543  - PLIB_DMA_ChannelXDisabledDisablesEvents
12544  Preconditions:
12545  None.
12546  Parameters:
12547  index - Identifier for the device instance
12548  Returns:
12549  - true - The ChannelXDisabled feature is supported on the device
12550  - false - The ChannelXDisabled feature is not supported on the device
12551  Remarks:
12552  None.
12553 */
12554 
12555 bool
12557  DMA_MODULE_ID index ) ;
12558 //******************************************************************************
12559 /* Function : PLIB_DMA_ExistsChannelX( DMA_MODULE_ID index )
12560  Summary:
12561  Identifies whether the ChannelX feature exists on the DMA module.
12562  Description:
12563  This function identifies whether the ChannelX feature is available on the
12564  DMA module.
12565  When this function returns true, these functions are supported on the device:
12566  - PLIB_DMA_ChannelXEnable
12567  - PLIB_DMA_ChannelXIsEnabled
12568  - PLIB_DMA_ChannelXDisable
12569  Preconditions:
12570  None.
12571  Parameters:
12572  index - Identifier for the device instance
12573  Returns:
12574  - true - The ChannelX feature is supported on the device
12575  - false - The ChannelX feature is not supported on the device
12576  Remarks:
12577  None.
12578 */
12579 
12580 bool
12582  DMA_MODULE_ID index ) ;
12583 //******************************************************************************
12584 /* Function : PLIB_DMA_ExistsChannelXChain( DMA_MODULE_ID index )
12585  Summary:
12586  Identifies whether the ChannelXChain feature exists on the DMA module.
12587  Description:
12588  This function identifies whether the ChannelXChain feature is available on the
12589  DMA module.
12590  When this function returns true, these functions are supported on the device:
12591  - PLIB_DMA_ChannelXChainToLower
12592  - PLIB_DMA_ChannelXChainToHigher
12593  Preconditions:
12594  None.
12595  Parameters:
12596  index - Identifier for the device instance
12597  Returns:
12598  - true - The ChannelXChain feature is supported on the device
12599  - false - The ChannelXChain feature is not supported on the device
12600  Remarks:
12601  None.
12602 */
12603 
12604 bool
12606  DMA_MODULE_ID index ) ;
12607 //******************************************************************************
12608 /* Function : PLIB_DMA_ExistsChannelXPatternLength( DMA_MODULE_ID index )
12609  Summary:
12610  Identifies whether the ChannelXPatternLength feature exists on the DMA module.
12611  Description:
12612  This function identifies whether the ChannelXPatternLength feature is available
12613  on the DMA module.
12614  When this function returns true, these functions are supported on the device:
12615  - PLIB_DMA_ChannelXPatternLengthSet
12616  - PLIB_DMA_ChannelXPatternLengthGet
12617  Preconditions:
12618  None.
12619  Parameters:
12620  index - Identifier for the device instance
12621  Returns:
12622  - true - The ChannelXPatternLength feature is supported on the device
12623  - false - The ChannelXPatternLength feature is not supported on the device
12624  Remarks:
12625  None.
12626 */
12627 
12628 bool
12630  DMA_MODULE_ID index ) ;
12631 //******************************************************************************
12632 /* Function : PLIB_DMA_ExistsChannelXPatternIgnoreByte( DMA_MODULE_ID index )
12633  Summary:
12634  Identifies whether the ChannelXPatternIgnoreByte feature exists on the DMA
12635  module.
12636  Description:
12637  This function identifies whether the ChannelXPatternIgnoreByte feature is
12638  available on the DMA module.
12639  When this function returns true, these functions are supported on the device:
12640  - PLIB_DMA_ChannelXPatternIgnoreByteEnable
12641  - PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled
12642  - PLIB_DMA_ChannelXPatternIgnoreByteDisable
12643  Preconditions:
12644  None.
12645  Parameters:
12646  index - Identifier for the device instance
12647  Returns:
12648  - true - The ChannelXPatternIgnoreByte feature is supported on the device
12649  - false - The ChannelXPatternIgnoreByte feature is not supported on the device
12650  Remarks:
12651  None.
12652 */
12653 
12654 bool
12656  DMA_MODULE_ID index ) ;
12657 //******************************************************************************
12658 /* Function : PLIB_DMA_ExistsChannelXBusy( DMA_MODULE_ID index )
12659  Summary:
12660  Identifies whether the ChannelXBusy feature exists on the DMA module.
12661  Description:
12662  This function identifies whether the ChannelXBusy feature is available on the
12663  DMA module.
12664  When this function returns true, these functions are supported on the device:
12665  - PLIB_DMA_ChannelXBusyActiveSet
12666  - PLIB_DMA_ChannelXBusyInActiveSet
12667  - PLIB_DMA_ChannelXBusyIsBusy
12668  Preconditions:
12669  None.
12670  Parameters:
12671  index - Identifier for the device instance
12672  Returns:
12673  - true - The ChannelXBusy feature is supported on the device
12674  - false - The ChannelXBusy feature is not supported on the device
12675  Remarks:
12676  None.
12677 */
12678 
12679 bool
12681  DMA_MODULE_ID index ) ;
12682 //******************************************************************************
12683 /* Function : PLIB_DMA_ExistsChannelXPatternIgnore( DMA_MODULE_ID index )
12684  Summary:
12685  Identifies whether the ChannelXPatternIgnore feature exists on the DMA module.
12686  Description:
12687  This function identifies whether the ChannelXPatternIgnore feature is available
12688  on the DMA module.
12689  When this function returns true, these functions are supported on the device:
12690  - PLIB_DMA_ChannelXPatternIgnoreSet
12691  - PLIB_DMA_ChannelXPatternIgnoreGet
12692  Preconditions:
12693  None.
12694  Parameters:
12695  index - Identifier for the device instance
12696  Returns:
12697  - true - The ChannelXPatternIgnore feature is supported on the device
12698  - false - The ChannelXPatternIgnore feature is not supported on the device
12699  Remarks:
12700  None.
12701 */
12702 
12703 bool
12705  DMA_MODULE_ID index ) ;
12706 //******************************************************************************
12707 /* Function : PLIB_DMA_ExistsChannelXTrigger( DMA_MODULE_ID index )
12708  Summary:
12709  Identifies whether the ChannelXTrigger feature exists on the DMA module.
12710  Description:
12711  This function identifies whether the ChannelXTrigger feature is available on
12712  the DMA module.
12713  When this function returns true, these functions are supported on the device:
12714  - PLIB_DMA_ChannelXTriggerEnable
12715  - PLIB_DMA_ChannelXTriggerIsEnabled
12716  - PLIB_DMA_ChannelXTriggerDisable
12717  Preconditions:
12718  None.
12719  Parameters:
12720  index - Identifier for the device instance
12721  Returns:
12722  - true - The ChannelXTrigger feature is supported on the device
12723  - false - The ChannelXTrigger feature is not supported on the device
12724  Remarks:
12725  None.
12726 */
12727 
12728 bool
12730  DMA_MODULE_ID index ) ;
12731 //******************************************************************************
12732 /* Function : PLIB_DMA_ExistsAbortTransfer( DMA_MODULE_ID index )
12733  Summary:
12734  Identifies whether the AbortTransfer feature exists on the DMA module.
12735  Description:
12736  This function identifies whether the AbortTransfer feature is available on
12737  the DMA module.
12738  When this function returns true, this function is supported on the device:
12739  - PLIB_DMA_AbortTransferSet
12740  Preconditions:
12741  None.
12742  Parameters:
12743  index - Identifier for the device instance
12744  Returns:
12745  - true - The AbortTransfer feature is supported on the device
12746  - false - The AbortTransfer feature is not supported on the device
12747  Remarks:
12748  None.
12749 */
12750 
12751 bool
12753  DMA_MODULE_ID index ) ;
12754 //******************************************************************************
12755 /* Function : PLIB_DMA_ExistsStartTransfer( DMA_MODULE_ID index )
12756  Summary:
12757  Identifies whether the StartTransfer feature exists on the DMA module.
12758  Description:
12759  This function identifies whether the StartTransfer feature is available on
12760  the DMA module.
12761  When this function returns true, this function is supported on the device:
12762  - PLIB_DMA_StartTransferSet
12763  Preconditions:
12764  None.
12765  Parameters:
12766  index - Identifier for the device instance
12767  Returns:
12768  - true - The StartTransfer feature is supported on the device
12769  - false - The StartTransfer feature is not supported on the device
12770  Remarks:
12771  None.
12772 */
12773 
12774 bool
12776  DMA_MODULE_ID index ) ;
12777 //******************************************************************************
12778 /* Function : PLIB_DMA_ExistsChannelXStartIRQ( DMA_MODULE_ID index )
12779  Summary:
12780  Identifies whether the ChannelXStartIRQ feature exists on the DMA module.
12781  Description:
12782  This function identifies whether the ChannelXStartIRQ feature is available
12783  on the DMA module.
12784  When this function returns true, this function is supported on the device:
12785  - PLIB_DMA_ChannelXStartIRQSet
12786  Preconditions:
12787  None.
12788  Parameters:
12789  index - Identifier for the device instance
12790  Returns:
12791  - true - The ChannelXStartIRQ feature is supported on the device
12792  - false - The ChannelXStartIRQ feature is not supported on the device
12793  Remarks:
12794  None.
12795 */
12796 
12797 bool
12799  DMA_MODULE_ID index ) ;
12800 //******************************************************************************
12801 /* Function : PLIB_DMA_ExistsChannelXAbortIRQ( DMA_MODULE_ID index )
12802  Summary:
12803  Identifies whether the ChannelXAbortIRQ feature exists on the DMA module.
12804  Description:
12805  This function identifies whether the ChannelXAbortIRQ feature is available
12806  on the DMA module.
12807  When this function returns true, this function is supported on the device:
12808  - PLIB_DMA_ChannelXAbortIRQSet
12809  Preconditions:
12810  None.
12811  Parameters:
12812  index - Identifier for the device instance
12813  Returns:
12814  - true - The ChannelXAbortIRQ feature is supported on the device
12815  - false - The ChannelXAbortIRQ feature is not supported on the device
12816  Remarks:
12817  None.
12818 */
12819 
12820 bool
12822  DMA_MODULE_ID index ) ;
12823 //******************************************************************************
12824 /* Function : PLIB_DMA_ExistsChannelXINTSourceFlag( DMA_MODULE_ID index )
12825  Summary:
12826  Identifies whether the ChannelXINTSourceFlag feature exists on the DMA module.
12827  Description:
12828  This function identifies whether the ChannelXINTSourceFlag feature is available
12829  on the DMA module.
12830  When this function returns true, these functions are supported on the device:
12831  - PLIB_DMA_ChannelXINTSourceFlagGet
12832  - PLIB_DMA_ChannelXINTSourceFlagSet
12833  - PLIB_DMA_ChannelXINTSourceFlagClear
12834  Preconditions:
12835  None.
12836  Parameters:
12837  index - Identifier for the device instance
12838  Returns:
12839  - true - The ChannelXINTSourceFlag feature is supported on the device
12840  - false - The ChannelXINTSourceFlag feature is not supported on the device
12841  Remarks:
12842  None.
12843 */
12844 
12845 bool
12847  DMA_MODULE_ID index ) ;
12848 //******************************************************************************
12849 /* Function : PLIB_DMA_ExistsChannelXINTSource( DMA_MODULE_ID index )
12850  Summary:
12851  Identifies whether the ChannelXINTSource feature exists on the DMA module.
12852  Description:
12853  This function identifies whether the ChannelXINTSource feature is available
12854  on the DMA module.
12855  When this function returns true, these functions are supported on the device:
12856  - PLIB_DMA_ChannelXINTSourceEnable
12857  - PLIB_DMA_ChannelXINTSourceDisable
12858  - PLIB_DMA_ChannelXINTSourceIsEnabled
12859  Preconditions:
12860  None.
12861  Parameters:
12862  index - Identifier for the device instance
12863  Returns:
12864  - true - The ChannelXINTSource feature is supported on the device
12865  - false - The ChannelXINTSource feature is not supported on the device
12866  Remarks:
12867  None.
12868 */
12869 
12870 bool
12872  DMA_MODULE_ID index ) ;
12873 //******************************************************************************
12874 /* Function : PLIB_DMA_ExistsChannelXSourceStartAddress( DMA_MODULE_ID index )
12875  Summary:
12876  Identifies whether the ChannelXSourceStartAddress feature exists on the DMA module.
12877  Description:
12878  This function identifies whether the ChannelXSourceStartAddress feature is available
12879  on the DMA module.
12880  When this function returns true, these functions are supported on the device:
12881  - PLIB_DMA_ChannelXSourceStartAddressGet
12882  - PLIB_DMA_ChannelXSourceStartAddressSet
12883  Preconditions:
12884  None.
12885  Parameters:
12886  index - Identifier for the device instance
12887  Returns:
12888  - true - The ChannelXSourceStartAddress feature is supported on the device
12889  - false - The ChannelXSourceStartAddress feature is not supported on the device
12890  Remarks:
12891  None.
12892 */
12893 
12894 bool
12896  DMA_MODULE_ID index ) ;
12897 //******************************************************************************
12898 /* Function : PLIB_DMA_ExistsChannelXDestinationStartAddress( DMA_MODULE_ID index )
12899  Summary:
12900  Identifies whether the ChannelXDestinationStartAddress feature exists on
12901  the DMA module.
12902  Description:
12903  This function identifies whether the ChannelXDestinationStartAddress feature
12904  is available on the DMA module.
12905  When this function returns true, these functions are supported on the device:
12906  - PLIB_DMA_ChannelXDestinationStartAddressGet
12907  - PLIB_DMA_ChannelXDestinationStartAddressSet
12908  Preconditions:
12909  None.
12910  Parameters:
12911  index - Identifier for the device instance
12912  Returns:
12913  - true - The ChannelXDestinationStartAddress feature is supported on the device
12914  - false - The ChannelXDestinationStartAddress feature is not supported on the device
12915  Remarks:
12916  None.
12917 */
12918 
12919 bool
12921  DMA_MODULE_ID index ) ;
12922 //******************************************************************************
12923 /* Function : PLIB_DMA_ExistsChannelXSourceSize( DMA_MODULE_ID index )
12924  Summary:
12925  Identifies whether the ChannelXSourceSize feature exists on the DMA module.
12926  Description:
12927  This function identifies whether the ChannelXSourceSize feature is available
12928  on the DMA module.
12929  When this function returns true, these functions are supported on the device:
12930  - PLIB_DMA_ChannelXSourceSizeGet
12931  - PLIB_DMA_ChannelXSourceSizeSet
12932  Preconditions:
12933  None.
12934  Parameters:
12935  index - Identifier for the device instance
12936  Returns:
12937  - true - The ChannelXSourceSize feature is supported on the device
12938  - false - The ChannelXSourceSize feature is not supported on the device
12939  Remarks:
12940  None.
12941 */
12942 
12943 bool
12945  DMA_MODULE_ID index ) ;
12946 //******************************************************************************
12947 /* Function : PLIB_DMA_ExistsChannelXDestinationSize( DMA_MODULE_ID index )
12948  Summary:
12949  Identifies whether the ChannelXDestinationSize feature exists on the DMA module.
12950  Description:
12951  This function identifies whether the ChannelXDestinationSize feature is available
12952  on the DMA module.
12953  When this function returns true, these functions are supported on the device:
12954  - PLIB_DMA_ChannelXDestinationSizeGet
12955  - PLIB_DMA_ChannelXDestinationSizeSet
12956  Preconditions:
12957  None.
12958  Parameters:
12959  index - Identifier for the device instance
12960  Returns:
12961  - true - The ChannelXDestinationSize feature is supported on the device
12962  - false - The ChannelXDestinationSize feature is not supported on the device
12963  Remarks:
12964  None.
12965 */
12966 
12967 bool
12969  DMA_MODULE_ID index ) ;
12970 //******************************************************************************
12971 /* Function : PLIB_DMA_ExistsChannelXSourcePointer( DMA_MODULE_ID index )
12972  Summary:
12973  Identifies whether the ChannelXSourcePointer feature exists on the DMA module.
12974  Description:
12975  This function identifies whether the ChannelXSourcePointer feature is available
12976  on the DMA module.
12977  When this function returns true, this function is supported on the device:
12978  - PLIB_DMA_ChannelXSourcePointerGet
12979  Preconditions:
12980  None.
12981  Parameters:
12982  index - Identifier for the device instance
12983  Returns:
12984  - true - The ChannelXSourcePointer feature is supported on the device
12985  - false - The ChannelXSourcePointer feature is not supported on the device
12986  Remarks:
12987  None.
12988 */
12989 
12990 bool
12992  DMA_MODULE_ID index ) ;
12993 //******************************************************************************
12994 /* Function : PLIB_DMA_ExistsChannelXDestinationPointer( DMA_MODULE_ID index )
12995  Summary:
12996  Identifies whether the ChannelXDestinationPointer feature exists on the DMA module.
12997  Description:
12998  This function identifies whether the ChannelXDestinationPointer feature is available
12999  on the DMA module.
13000  When this function returns true, this function is supported on the device:
13001  - PLIB_DMA_ChannelXDestinationPointerGet
13002  Preconditions:
13003  None.
13004  Parameters:
13005  index - Identifier for the device instance
13006  Returns:
13007  - true - The ChannelXDestinationPointer feature is supported on the device
13008  - false - The ChannelXDestinationPointer feature is not supported on the device
13009  Remarks:
13010  None.
13011 */
13012 
13013 bool
13015  DMA_MODULE_ID index ) ;
13016 //******************************************************************************
13017 /* Function : PLIB_DMA_ExistsChannelXCellSize( DMA_MODULE_ID index )
13018  Summary:
13019  Identifies whether the ChannelXCellSize feature exists on the DMA module.
13020  Description:
13021  This function identifies whether the ChannelXCellSize feature is available on
13022  the DMA module.
13023  When this function returns true, these functions are supported on the device:
13024  - PLIB_DMA_ChannelXCellSizeGet
13025  - PLIB_DMA_ChannelXCellSizeSet
13026  Preconditions:
13027  None.
13028  Parameters:
13029  index - Identifier for the device instance
13030  Returns:
13031  - true - The ChannelXCellSize feature is supported on the device
13032  - false - The ChannelXCellSize feature is not supported on the device
13033  Remarks:
13034  None.
13035 */
13036 
13037 bool
13039  DMA_MODULE_ID index ) ;
13040 //******************************************************************************
13041 /* Function : PLIB_DMA_ExistsChannelXCellProgressPointer( DMA_MODULE_ID index )
13042  Summary:
13043  Identifies whether the ChannelXCellProgressPointer feature exists on the
13044  DMA module.
13045  Description:
13046  This function identifies whether the ChannelXCellProgressPointer feature is
13047  available on the DMA module.
13048  When this function returns true, this function is supported on the device:
13049  - PLIB_DMA_ChannelXCellProgressPointerGet
13050  Preconditions:
13051  None.
13052  Parameters:
13053  index - Identifier for the device instance
13054  Returns:
13055  - true - The ChannelXCellProgressPointer feature is supported on the device
13056  - false - The ChannelXCellProgressPointer feature is not supported on the device
13057  Remarks:
13058  None.
13059 */
13060 
13061 bool
13063  DMA_MODULE_ID index ) ;
13064 //******************************************************************************
13065 /* Function : PLIB_DMA_ExistsChannelXPatternData( DMA_MODULE_ID index )
13066  Summary:
13067  Identifies whether the ChannelXPatternData feature exists on the DMA module
13068  Description:
13069  This function identifies whether the ChannelXPatternData feature is available
13070  on the DMA module.
13071  When this function returns true, these functions are supported on the device:
13072  - PLIB_DMA_ChannelXPatternDataGet
13073  - PLIB_DMA_ChannelXPatternDataSet
13074  Preconditions:
13075  None.
13076  Parameters:
13077  index - Identifier for the device instance
13078  Returns:
13079  - true - The ChannelXPatternData feature is supported on the device
13080  - false - The ChannelXPatternData feature is not supported on the device
13081  Remarks:
13082  None.
13083 */
13084 
13085 bool
13087  DMA_MODULE_ID index ) ;
13088 //DOM-IGNORE-BEGIN
13089 //DOM-IGNORE-END
13090  // #ifndef _PLIB_DMA_H
13091 /*******************************************************************************
13092  End of File
13093 */
13094 
13095 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h*/
13096 /* CLOSE_FILE Include File */
13097 
13098 // *****************************************************************************
13099 // *****************************************************************************
13100 // Section: Data Types
13101 // *****************************************************************************
13102 // *****************************************************************************
13103 // *****************************************************************************
13104 /* DMA System Service Channel None
13105  Summary:
13106  DMA channel none
13107  Description:
13108  This constant identifies the specification of no choice from client
13109  for allocating a particular DMA channel.
13110  Remarks:
13111  This constant should be used in place of hard-coded numeric literals.
13112 */
13113 //DOM-IGNORE-BEGIN
13114 #define DMA_CHANNEL_NONE ( ( DMA_CHANNEL ) - 1 )
13115 //DOM-IGNORE-END
13116 // *****************************************************************************
13117 /* DMA System Service Channel Any
13118  Summary:
13119  Identifies the client specification to allocate any available DMA channel.
13120  Description:
13121  This constant identifies the specification by the client
13122  to allocate any available DMA channel.
13123  Remarks:
13124  This constant should be used in place of hard-coded numeric literals.
13125 */
13126 //DOM-IGNORE-BEGIN
13127 #define DMA_CHANNEL_ANY ( ( DMA_CHANNEL ) - 2 )
13128 //DOM-IGNORE-END
13129 // *****************************************************************************
13130 /* DMA System Service Channel Count
13131  Summary:
13132  Identifies the maximum number of DMA channel handles to be defined.
13133  Description:
13134  This constant identifies the maximum number of DMA channel handles
13135  that should be defined.
13136  Remarks:
13137  This value is derived from device-specific header files defined as
13138  part of the peripheral libraries.
13139 */
13140 #define SYS_DMA_CHANNEL_COUNT DMA_NUMBER_OF_CHANNELS
13141 // *****************************************************************************
13142 /* DMA System Service Channel Handle
13143  Summary:
13144  Assigns the handle for requested channel.
13145  Description:
13146  A channel handle value is returned by a call to the SYS_DMA_ChannelAllocate
13147  function. This handle is associated with the channel number that is used for
13148  data transfer and it allows the application to track the data transfer.
13149  The channel handle once assigned to a client expires when the
13150  client calls SYS_DMA_ChannelRelease.
13151  exits.
13152  Remarks:
13153  None.
13154 */
13155 
13156 typedef
13157 uintptr_t
13159 // *****************************************************************************
13160 /* DMA System Service Invalid Channel Handle
13161  Summary:
13162  Defines an invalid channel handle.
13163  Description:
13164  This is the definition of an invalid channel handle. An invalid buffer handle
13165  is returned by SYS_DMA_ChannelAllocate function if the channel number
13166  request was not successful.
13167  Remarks:
13168  None.
13169 */
13170 #define SYS_DMA_CHANNEL_HANDLE_INVALID ( ( SYS_DMA_CHANNEL_HANDLE ) ( - 1 ) )
13171 // *****************************************************************************
13172 /* DMA stop in idle mode
13173  Summary:
13174  Enable/Disable DMA operations in Idle mode.
13175  Description:
13176  This data type allows enabling/disabling of DMA operations in idle mode.
13177  Remarks:
13178  The field 'sidl' (in init data structure 'SYS_DMA_INIT') is enable/disable
13179  while initializing the DMA module by calling SYS_DMA_Initialize.
13180  This feature may not be available on all devices. Refer to the specific device
13181  data sheet to determine availability.
13182 */
13183 
13184 typedef
13185  enum
13186  {
13187  /* When the CPU enters idle mode, the DMA module continue operations */
13189  /* When the CPU enters idle mode, the DMA module will discontinue operations */
13191  } SYS_DMA_SIDL ;
13192 // *****************************************************************************
13193 /* DMA Channel chaining priority
13194  Summary:
13195  Identifies the priority of chaining channel.
13196  Description:
13197  This data type identifies the priority of chaining channel.
13198  Channel chaining priority identifies the channel that will be enabled
13199  on completion of block data transfer on the master channel.
13200  Remarks:
13201  None.
13202 */
13203 
13204 typedef
13205  enum
13206  {
13207  /* Chain to channel higher in natural priority */
13209  /* Chain to channel lower in natural priority */
13212 // *****************************************************************************
13213 /* DMA Channel ignore pattern match
13214  Summary:
13215  Enables/Disables the feature to ignore a byte between a 2-byte match abort
13216  pattern.
13217  Description:
13218  This data type allows enabling/disabling the feature to ignore a byte
13219  between a 2-byte match abort pattern.
13220  Remarks:
13221  This feature may not be available on all devices. Refer to the specific device
13222  data sheet to determine availability.
13223 */
13224 
13225 typedef
13226  enum
13227  {
13228  /* Disabling the feature to ignore a byte between a 2-byte match abort pattern. */
13230  /* Enable the feature to ignore a byte between a 2-byte match abort pattern. */
13233 // *****************************************************************************
13234 /* DMA channel CRC mode
13235  Summary:
13236  Identifies the operation mode of the CRC module.
13237  Description:
13238  This data type identifies CRC operating mode. The CRC computation can be
13239  in background mode or append mode.
13240  Remarks:
13241  None.
13242 */
13243 
13244 typedef
13245  enum
13246  {
13247  /* DMA reads the data from the source, passes it through the CRC module and
13248  writes it to the destination. the calculated CRC is left in the DCRCDATA
13249  register at the end of the block transfer. */
13251  /* DMA only feeds source data to the CRC module. it does not write source data
13252  to the destination address. When a block transfer complete or pattern abort
13253  event occur, The DMA writes the CRC value to the destination address */
13256 // *****************************************************************************
13257 /* DMA channel CRC write order
13258  Summary:
13259  Identifies altering/maintaining write order post CRC computation.
13260  Description:
13261  This data type identifies write byte order selection post CRC
13262  computation.
13263  Remarks:
13264  None.
13265 */
13266 
13267 typedef
13268  enum
13269  {
13270  /* Source data is written to the destination unchanged regardless
13271  of the selected pre-CRC byte order. */
13273  /* Source data is written to the destination reordered according
13274  to the selected pre-CRC byte order. */
13277 // *****************************************************************************
13278 /* DMA channel operation modes
13279  Summary:
13280  Identifies the available DMA operating modes.
13281  Description:
13282  This data type Identifies the available DMA operating modes.
13283  The supported DMA modes are not mutually exclusive, but can be simultaneously
13284  operational.
13285  Remarks:
13286  These supported DMA modes can be logically OR'd together. They are passed
13287  into the SYS_DMA_ChannelSetup function through the modeEnable parameter.
13288 */
13289 
13290 typedef
13291  enum
13292  {
13293  /* The normal DMA operation mode. The DMA channel will transfer data from
13294  a source to a destination without CPU intervention */
13295  SYS_DMA_CHANNEL_OP_MODE_BASIC /*DOM-IGNORE-BEGIN*/
13296  = ( 1 << 0 ) /*DOM-IGNORE-END*/
13297  ,
13298  /* Pattern Match abort mode allows the user to end a transfer if data
13299  written during a transaction matches a specific pattern, as defined by
13300  the DCHxDAT register */
13302  = ( 1 << 1 ) /*DOM-IGNORE-END*/
13303  ,
13304  /* Channel chaining operating mode enhances the normal DMA channel
13305  operations. A channel(slave) can be chained to an adjacent channel(master).
13306  The slave channel will be enabled when a block transfer of the master
13307  channel completes. */
13308  /* only one of the below two chaining priorities must be provided.
13309  Chaining priority High. */
13311  = ( 1 << 2 ) /*DOM-IGNORE-END*/
13312  ,
13313  /* Chaining priority Low */
13315  = ( 1 << 3 ) /*DOM-IGNORE-END*/
13316  ,
13317  /* Auto enable operating mode allows a channel to be kept active, even if a
13318  block transfer completes or pattern match occurs. This prevents the user
13319  from having to re-enable the channel each time a block transfer completes. */
13320  SYS_DMA_CHANNEL_OP_MODE_AUTO/*DOM-IGNORE-BEGIN*/
13321  = ( 1 << 4 ) /*DOM-IGNORE-END*/
13322  ,
13323  /* CRC operating mode allows computation of 16, 32-bit CRC. */
13324  SYS_DMA_CHANNEL_OP_MODE_CRC/*DOM-IGNORE-BEGIN*/
13325  = ( 1 << 5 ) /*DOM-IGNORE-END*/
13327 // *****************************************************************************
13328 /* DMA channel CRC mode
13329  Summary:
13330  Defines the attributes for CRC operation mode.
13331  Description:
13332  This data type defines the attributes for CRC operation mode.
13333  Remarks:
13334  This feature may not be available on all devices. Refer to the specific device
13335  data sheet to determine availability.
13336 */
13337 
13338 typedef
13339  struct
13340  {
13341  /* CRC type (PLIB-level).
13342  Type Selection identifies whether the CRC module will calculate an IP
13343  header checksum or an LFSR CRC */
13344  DMA_CRC_TYPE type ;
13345  /* CRC mode, Background or Append */
13347  /* Polynomial length, This value is redundant when the selected CRC type is
13348  IP header checksum. When the CRC type is LFSR, Identifies the length of
13349  the polynomial. */
13350  uint8_t polyLength ;
13351  /* Bit order (PLIB-level).
13352  Identifies whether the CRC is computed LSb or MSb first */
13353  DMA_CRC_BIT_ORDER bitOrder ;
13354  /* Byte order (PLIB-level).
13355  Identifies the byte selection order input pre-CRC Generator. */
13356  DMA_CRC_BYTE_ORDER byteOrder ;
13357  /* Post CRC Write order */
13358  SYS_DMA_CRC_WRITE_ORDER writeOrder ;
13359  /* CRC data feed: While enabling the CRC mode, this field gives
13360  the seed for the CRC computation. On block transfer complete or
13361  pattern match abort the field have the computed CRC. */
13362  uint32_t data ;
13363  /* XOR bit mask, This value is redundant when the selected CRC type is
13364  IP header checksum. When the CRC type is LFSR, Identifies the XOR
13365  bit mask input to the shift register during CRC computation. */
13366  uint32_t xorBitMask ;
13368 // *****************************************************************************
13369 /* DMA System service Events
13370  Summary:
13371  Enumeration of possible DMA System service events.
13372  Description:
13373  This data type provides an enumeration of all possible DMA System service events.
13374  Remarks:
13375  None.
13376 */
13377 
13378 typedef
13379  enum
13380  {
13381  /* Data was transferred successfully. */
13383  /* Error while processing the request */
13385  /* Data transfer was aborted. */
13387  /* No events yet. */
13390 // *****************************************************************************
13391 /* DMA System service Error
13392  Summary:
13393  Indicates the error information for the DMA System service.
13394  Description:
13395  This enumeration indicates the error information for the DMA System service.
13396  Remarks:
13397  None.
13398 */
13399 
13400 typedef
13401  enum
13402  {
13403  /* Data was transferred successfully. */
13404  SYS_DMA_ERROR_NONE /*DOM-IGNORE-BEGIN*/
13405  = 1 << 0 ,
13406  /* DOM-IGNORE-END*/
13407  /* DMA address error. */
13408  SYS_DMA_ERROR_ADDRESS_ERROR /*DOM-IGNORE-BEGIN*/
13409  = 1 << 1 /* DOM-IGNORE-END*/
13410  } SYS_DMA_ERROR ;
13411 // *****************************************************************************
13412 /* DMA Initialization data
13413  Summary:
13414  Defines the data required to initialize the DMA subsystem.
13415  Description:
13416  This data type defines the data required to initialize the DMA subsystem.
13417  Remarks:
13418  This feature may not be available on all devices. Refer to the specific device
13419  data sheet to determine availability.
13420 */
13421 
13422 typedef
13423  struct
13424  {
13425  /* Enable/Disable stop in idle mode feature */
13426  SYS_DMA_SIDL sidl ;
13427  } SYS_DMA_INIT ;
13428 // *****************************************************************************
13429 /* Data width options */
13430 
13431 typedef
13432  enum
13433  {
13434  /* Data width configuration feature is not available */
13436  } SYS_DMA_DATA_WIDTH ;
13437 // *****************************************************************************
13438 /* DMA descriptor control
13439  Summary:
13440  Defines the descriptor control for linked list operation.
13441  Description:
13442  This data type defines the descriptor control for linked list operation.
13443  Remarks:
13444  This feature may not be available on all devices. Refer to the specific device
13445  data sheet to determine availability.
13446 */
13447 
13448 typedef
13449  union
13450  {
13451  /* Feature is not supported */
13452  ;
13454 // *****************************************************************************
13455 // *****************************************************************************
13456 // Section: Initialization and Task Functions
13457 // *****************************************************************************
13458 // *****************************************************************************
13459 //******************************************************************************
13460 /* Function:
13461  void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
13462  Summary:
13463  Maintains the system service's state machine.
13464 
13465  Description:
13466  This function is used to maintain the DMA system service's internal state
13467  machine. This function services events on a specific DMA channel.
13468  Precondition:
13469  DMA should have been initialized by calling SYS_DMA_Initialize.
13470  Parameters:
13471  object - Object handle for the DMA module (returned from
13472  SYS_DMA_Initialize)
13473  activeChannel - DMA channel number to be serviced.
13474  Returns:
13475  None.
13476  Example:
13477  <code>
13478  // 'object' Returned from SYS_DMA_Initialize
13479  void __ISR(_DMA3_VECTOR,ipl5)_InterruptHandler_BT_USART_RX_DMA_CHANNEL(void)
13480  {
13481  SYS_DMA_Tasks(object, DMA_CHANNEL_3);
13482  }
13483  </code>
13484  Remarks:
13485  This function is normally not called directly by an application. It is
13486  called by the system's task/interrupt routines.
13487  */
13488 
13489 void
13490  SYS_DMA_Tasks (
13491  SYS_MODULE_OBJ object ,
13492  DMA_CHANNEL activeChannel ) ;
13493 //******************************************************************************
13494 /* For backward compatibility */
13495 #define SYS_DMA_TasksISR( object , activeChannel ) SYS_DMA_Tasks ( object , activeChannel )
13496  // #ifndef _SYS_DMA_DEFINITIONS_H
13497 /*******************************************************************************
13498  End of File
13499 */
13500 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h*/
13501 /* CLOSE_FILE Include File */
13502 
13503 // DOM-IGNORE-BEGIN
13504 // DOM-IGNORE-END
13505 // *****************************************************************************
13506 // *****************************************************************************
13507 // Section: DMA System Service Interface Routines
13508 // *****************************************************************************
13509 // *****************************************************************************
13510 // *****************************************************************************
13511 /* DMA System service Transfer Event Handler Function
13512  Summary:
13513  Pointer to a DMA System service Transfer Event handler function.
13514  Description:
13515  This data type defines a DMA System service Transfer Event Handler Function.
13516  A DMA system service client must register an transfer event handler function of
13517  this type to receive transfer related events from the system service.
13518  If the event is SYS_DMA_TRANSFER_EVENT_COMPLETE, this means that the data
13519  was transferred successfully. The channelHandle parameter contains the channel
13520  handle of the channel on which the transfer was processed.
13521  If the event is SYS_DMA_TRANSFER_EVENT_ERROR, this means that the data was
13522  not transferred successfully. TThe channelHandle parameter contains the channel
13523  handle of the channel on which the transfer had failed.
13524  The contextHandle parameter contains the context handle that was provided by
13525  the client at the time of registering the event handler. This context handle
13526  can be anything that the client consider helpful or necessary to identify
13527  the client context object associated with the channel of the system
13528  service that generated the event.
13529  The event handler function executes in an interrupt context when DMA is setup
13530  to start operation by an interrupt trigger source. It is recommended of the
13531  application to not perform process intensive operations with in this
13532  function.
13533  Remarks:
13534  None.
13535 */
13536 
13537 typedef
13539 SYS_DMA_CHANNEL_HANDLE handle ,
13540 uintptr_t contextHandle ) ;
13541 // *****************************************************************************
13542 // *****************************************************************************
13543 // Section: Initialization and Task Functions
13544 // *****************************************************************************
13545 // *****************************************************************************
13546 //******************************************************************************
13547 /* Function:
13548  SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT * const init)
13549  Summary:
13550  Initializes and Enables the DMA Controller.
13551  Description:
13552  This function Enables the DMA module. Enable/Disable stop in idle mode
13553  feature based on the passed parameter value.
13554  This function initializes the DMA module making it ready for clients to
13555  open and use it. The initialization data is specified by the init parameter.
13556  Precondition:
13557  None.
13558  Parameters:
13559  init - Pointer to the data structure containing any data
13560  necessary to initialize the hardware. This pointer may
13561  be null if no data is required and default
13562  initialization is to be used.
13563  Returns:
13564  If successful, returns a valid handle to the DMA module object.
13565  Otherwise, it returns SYS_MODULE_OBJ_INVALID.
13566  Example:
13567  <code>
13568  SYS_MODULE_OBJ objectHandle;
13569  SYS_DMA_INIT initParam;
13570  initParam.sidl = SYS_DMA_SIDL_ENABLE;
13571  objectHandle = SYS_DMA_Initialize(DRV_I2S_INDEX_1,
13572  (SYS_MODULE_INIT*)initParam);
13573  if (SYS_MODULE_OBJ_INVALID == objectHandle)
13574  {
13575  // Handle error
13576  }
13577  </code>
13578  Remarks:
13579  This function must be called before any other DMA systems service routines
13580  are called.
13581  Not all features are available on all micro-controllers.
13582 */
13583 
13584 SYS_MODULE_OBJ
13586  const SYS_MODULE_INIT * const init ) ;
13587 // *****************************************************************************
13588 // *****************************************************************************
13589 // Section: Channel Setup and management functions
13590 // *****************************************************************************
13591 // *****************************************************************************
13592 //******************************************************************************
13593 /* Function:
13594  SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate (DMA_CHANNEL channel)
13595  Summary:
13596  Allocates the specified DMA channel and returns a handle to it.
13597  Description:
13598  This function opens the specified DMA channel and provides a
13599  handle that must be provided to all other client-level operations to
13600  identify the caller and the DMA channel.
13601  Precondition:
13602  Function SYS_DMA_Initialize must have been called before calling this
13603  function.
13604  Parameters:
13605  channel - Channel number requested for allocation.
13606  When channel number specified is DMA_CHANNEL_ANY
13607  a random channel is allocated for DMA transfers.
13608  Returns:
13609  The channel handle for the requested channel number.
13610  If an error occurs, the return value is SYS_DMA_CHANNEL_HANDLE_INVALID.
13611  Error can occur.
13612  - if the requested channel number is invalid.
13613  - if the requested channel number is not free.
13614  Example:
13615  <code>
13616  DMA_CHANNEL channel;
13617  SYS_DMA_CHANNEL_HANDLE handle
13618  channel = DMA_CHANNEL_2;
13619  handle = SYS_DMA_ChannelAllocate(channel);
13620  if (SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
13621  {
13622  // Failed to allocate the channel
13623  }
13624  else
13625  {
13626  // Proceed with setting up the channel and adding the transfer
13627  }
13628  </code>
13629  Remarks:
13630  The handle returned is valid until the SYS_DMA_ChannelRelease routine is called.
13631  This function must be called before any other DMA channel Setup and management
13632  routines are called
13633 */
13634 
13637  DMA_CHANNEL channel ) ;
13638 //******************************************************************************
13639 /* Function:
13640  void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
13641  Summary:
13642  Deallocates and frees the channel specified by the handle.
13643  Description:
13644  This function deallocates an allocated-channel of the DMA module,
13645  invalidating the handle.
13646  Precondition:
13647  DMA should have been initialized by calling SYS_DMA_Initialize.
13648  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate
13649  Parameters:
13650  handle - A valid allocated-channel handle, returned from the service's
13651  Allocate routine
13652  Returns:
13653  None.
13654  Example:
13655  <code>
13656  DMA_CHANNEL channel;
13657  SYS_DMA_CHANNEL_HANDLE handle;
13658  channel = DMA_CHANNEL_2;
13659  handle = SYS_DMA_ChannelAllocate(channel);
13660  SYS_DMA_ChannelRelease(handle);
13661  </code>
13662  Remarks:
13663  After calling this routine, the handle passed in "handle" must not be used
13664  with any of the remaining service's routines. A new handle must be obtained by
13665  calling SYS_DMA_ChannelAllocate before the caller may use the service again
13666 */
13667 
13668 void
13670  SYS_DMA_CHANNEL_HANDLE handle ) ;
13671 //******************************************************************************
13672 /* Function:
13673  void SYS_DMA_ChannelSetup
13674  (
13675  SYS_DMA_CHANNEL_HANDLE handle,
13676  SYS_DMA_CHANNEL_OP_MODE modeEnable
13677  DMA_TRIGGER_SOURCE eventSrc
13678  )
13679  Summary:
13680  Setup the DMA channel parameters.
13681  Description:
13682  This function sets up the DMA channel parameters.
13683  It sets the channel priority and enables the mode of operations for the
13684  current system design.
13685  Precondition:
13686  DMA should have been initialized by calling SYS_DMA_Initialize.
13687  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13688  Parameters:
13689  handle - Handle of the DMA channel as returned by the
13690  SYS_DMA_ChannelAllocate function.
13691  priority - The priority to be associated to the channel.
13692  modeEnable - The supported operating modes to be enabled.
13693  This parameter can be logically ORed to specify
13694  multiple options.
13695  eventSrc - The event causing the cell transfer start.
13696  Returns:
13697  None.
13698  Example:
13699  <code>
13700  // 'handle' is a valid handle returned
13701  // by the SYS_DMA_ChannelAllocate function.
13702  SYS_DMA_CHANNEL_OP_MODE modeEnable;
13703  DMA_TRIGGER_SOURCE eventSrc;
13704  channel = DMA_CHANNEL_2;
13705  modeEnable = (SYS_DMA_CHANNEL_OP_MODE_BASIC | SYS_DMA_CHANNEL_OP_MODE_CRC);
13706  eventSrc = DMA_TRIGGER_USART_1_TRANSMIT;
13707  // Setup channel number, and enables basic and CRC mode
13708  SYS_DMA_ChannelSetup(handle, modeEnable,eventSrc);
13709  </code>
13710  Remarks:
13711  If SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT, SYS_DMA_CHANNEL_OP_MODE_CHAIN or
13712  SYS_DMA_CHANNEL_OP_MODE_CRC mode of operation is enabled, then corresponding
13713  mode setup API's needs to be called to set the related parameters.
13714  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE then
13715  SYS_DMA_ChannelForceStart must be called to start the DMA channel transfer.
13716  Not all features are available on all microcontrollers.
13717  */
13718 
13719 void
13721  SYS_DMA_CHANNEL_HANDLE handle ,
13722  SYS_DMA_CHANNEL_OP_MODE modeEnable ,
13723  DMA_TRIGGER_SOURCE eventSrc ) ;
13724 //******************************************************************************
13725 /* Function:
13726  void SYS_DMA_ChannelSetupMatchAbortMode
13727  (
13728  SYS_DMA_CHANNEL_HANDLE handle,
13729  uint16_t pattern,
13730  DMA_PATTERN_LENGTH length,
13731  SYS_DMA_CHANNEL_IGNORE_MATCH ignore,
13732  uint8_t ignorePattern
13733  )
13734  Summary:
13735  Setup the pattern match abort mode.
13736  Description:
13737  This function sets up the termination of DMA operation when the specified
13738  pattern is matched. Additionally on supported parts the function also
13739  sets up the ignoring of part of a pattern(8-bit) from match abort
13740  pattern(16-bit).
13741  Precondition:
13742  DMA should have been initialized by calling SYS_DMA_Initialize.
13743  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13744  The function SYS_DMA_ChannelSetup must be called to enable
13745  SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT before setting up pattern
13746  match mode features.
13747  Parameters:
13748  handle - Handle of the DMA channel as returned by the
13749  SYS_DMA_ChannelAllocate function.
13750  pattern - The pattern that needs to be matched to abort a DMA transfer.
13751  length - Match pattern length can be 1-byte or 2-byte.
13752  ignore - Enable/Disable a byte between a 2-byte pattern match.
13753  ignorePattern - The part of the pattern(8-bit) that needs to be ignored
13754  from the match abort pattern(16-bit)
13755  Returns:
13756  None.
13757  Example:
13758  <code>
13759  // Example 1
13760  // The following code is for a device with an 8-bit pattern value and no
13761  // support for pattern match ignore feature
13762  // 'handle' is a valid handle returned
13763  // by the SYS_DMA_ChannelAllocate function.
13764  uint16_t pattern;
13765  DMA_PATTERN_LENGTH length;
13766  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
13767  uint8_t ignorePattern;
13768  pattern = 0x00; //Stop transfer on detection of a NULL character
13769  length = DMA_PATTERN_LENGTH_NONE;
13770  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_DISABLE;
13771  ignorePattern = 0;
13772  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
13773  ignoreEnable, ignorePattern);
13774  // Example 2
13775  // The following code is for a device with a 16-bit pattern value and
13776  // support for pattern match ignore feature
13777  // 'handle' is a valid handle returned
13778  // by the SYS_DMA_ChannelAllocate function.
13779  uint16_t pattern;
13780  DMA_PATTERN_LENGTH length;
13781  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
13782  uint8_t ignorePattern;
13783  pattern = 0x0D0A; //Stop transfer on detection of '\r\n'
13784  length = DMA_PATTERN_MATCH_LENGTH_2BYTES;
13785  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_ENABLE;
13786  ignorePattern = 0x00; \\ Any null character between the termination pattern
13787  \\ '\r' and '\n' is ignored.
13788  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
13789  ignore, ignorePattern);
13790  </code>
13791  Remarks:
13792  The parameter 'pattern' (8-bit or 16-bit) is device-specific.
13793  Not all features are available on all devices.
13794  Refer to the specific device data sheet for details.
13795 */
13796 
13797 void
13799  SYS_DMA_CHANNEL_HANDLE handle ,
13800  uint16_t pattern ,
13801  DMA_PATTERN_LENGTH length ,
13803  uint8_t ignorePattern ) ;
13804 //******************************************************************************
13805 /* Function:
13806  void SYS_DMA_ChannelCRCSet
13807  (
13808  SYS_DMA_CHANNEL_HANDLE handle,
13809  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc
13810  )
13811  Summary:
13812  Sets up the CRC operation mode.
13813  Description:
13814  This function sets up the CRC computation features.
13815  Precondition:
13816  DMA should have been initialized by calling SYS_DMA_Initialize.
13817  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13818  The function SYS_DMA_ChannelSetup must be called to enable
13819  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
13820  Parameters:
13821  handle - Handle of the DMA channel as returned by the
13822  SYS_DMA_ChannelAllocate function.
13823  crc.type - CRC will calculate an IP header checksum or an LFSR CRC.
13824  crc.mode - Compute the CRC in Background/Append mode.
13825  crc.polyLength - Denotes the length of the polynomial.
13826  crc.bitOrder - CRC is calculated LSb/MSb first.
13827  crc.byteOrder - Byte selection order input pre-CRC Generator
13828  crc.writeOrder - Write byte order selection post-CRC computation
13829  crc.data - Computed/Seed CRC
13830  crc.xorBitMask - Enable/Disable XOR bit mask on the corresponding bits
13831  when mode is LFSR
13832  Returns:
13833  None.
13834  Example:
13835  <code>
13836  //Example 1
13837  // DMA calculation using the CRC background mode
13838  // 'handle' is a valid handle returned
13839  // by the SYS_DMA_ChannelAllocate function.
13840  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc;
13841  crc.type = DMA_CRC_LFSR;
13842  crc.mode = SYS_DMA_CHANNEL_CRC_MODE_BACKGROUND;
13843  crc.polyLength = 16;
13844  crc.bitOrder = DMA_CRC_BIT_ORDER_LSB;
13845  crc.byteOrder = DMA_CRC_BYTEORDER_NO_SWAPPING;
13846  crc.writeOrder = SYS_DMA_CRC_WRITE_ORDER_MAINTAIN;
13847  crc.data = 0xFFFF;
13848  crc.xorBitMask = 0x1021;
13849  SYS_DMA_ChannelCRCSet(handle, crc);
13850  </code>
13851  Remarks:
13852  This feature may not be available on all devices. Refer to the specific device
13853  data sheet to determine availability.
13854 */
13855 
13856 void
13858  SYS_DMA_CHANNEL_HANDLE handle ,
13860 //******************************************************************************
13861 /* Function:
13862  uint32_t SYS_DMA_ChannelCRCGet(void)
13863  Summary:
13864  Returns the computed CRC.
13865  Description:
13866  This function returns the computed CRC
13867  Precondition:
13868  DMA should have been initialized by calling SYS_DMA_Initialize.
13869  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13870  The function SYS_DMA_ChannelSetup must be called to enable
13871  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
13872  The CRC generator must have been previously setup using
13873  SYS_DMA_ChannelCRCSet.
13874  Parameters:
13875  None
13876  Returns:
13877  uint32_t - The Computed CRC.
13878  Example:
13879  <code>
13880  uint32_t computedCRC;
13881  computedCRC = SYS_DMA_ChannelCRCGet();
13882  </code>
13883  Remarks:
13884  To get the computed CRC value this function must be called after the block
13885  transfer completion event (i.e., after getting and processing the callback
13886  registered with SYS_DMA_ChannelTransferEventHandlerSet).
13887  This feature may not be available on all devices. Refer to the specific device
13888  data sheet to determine availability.
13889 */
13890 
13891 uint32_t
13892  SYS_DMA_ChannelCRCGet ( void ) ;
13893 //******************************************************************************
13894 /* Function:
13895  void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
13896  Summary:
13897  Enables a channel.
13898  Description:
13899  This function enables a channel.
13900  Precondition:
13901  DMA should have been initialized by calling SYS_DMA_Initialize.
13902  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13903  The function SYS_DMA_ChannelSetup must have been called to setup and
13904  enable the required features.
13905  Parameters:
13906  handle - Handle of the DMA channel as returned by the
13907  SYS_DMA_ChannelAllocate function.
13908  Returns:
13909  None.
13910  Example:
13911  <code>
13912  // 'handle' is a valid handle returned
13913  // by the SYS_DMA_ChannelAllocate function.
13914  SYS_DMA_ChannelEnable(handle);
13915  </code>
13916  Remarks:
13917  This function may not required to be called when starting DMA setup
13918  (by SYS_DMA_ChannelSetup) and transfer Add (by SYS_DMA_ChannelTransferAdd).
13919  But may be needed to be called in the registered callback to enable the
13920  channel and continue the data transfer with the existing transfer parameters
13921  previously set with 'SYS_DMA_ChannelTransferAdd'.
13922  The DMA channel is by default disabled on the completion of block
13923  transfer(callback generated)
13924 */
13925 
13926 void
13928  SYS_DMA_CHANNEL_HANDLE handle ) ;
13929 //******************************************************************************
13930 /* Function:
13931  void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
13932  Summary:
13933  Disables a channel.
13934  Description:
13935  This function disables a channel.
13936  Precondition:
13937  DMA should have been initialized by calling SYS_DMA_Initialize.
13938  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13939  The function SYS_DMA_ChannelSetup must have been called to setup and
13940  enable the required features.
13941  A DMA channel should have been enabled either by calling
13942  'SYS_DMA_ChannelTransferAdd' or 'SYS_DMA_ChannelEnable'
13943  Parameters:
13944  handle - Handle of the DMA channel as returned by the
13945  SYS_DMA_ChannelAllocate function.
13946  Returns:
13947  None.
13948  Example:
13949  <code>
13950  // 'handle' is a valid handle returned
13951  // by the SYS_DMA_ChannelAllocate function.
13952  SYS_DMA_ChannelDisable(handle);
13953  </code>
13954  Remarks:
13955  None.
13956 */
13957 
13958 void
13960  SYS_DMA_CHANNEL_HANDLE handle ) ;
13961 //******************************************************************************
13962 /* Function:
13963  void SYS_DMA_ChannelTransferAdd
13964  (
13965  SYS_DMA_CHANNEL_HANDLE handle,
13966  const void *srcAddr, size_t srcSize
13967  const void *destAddr, size_t destSize,
13968  size_t cellSize
13969  )
13970  Summary:
13971  Adds a data transfer to a DMA channel and Enables the channel to start
13972  data transfer.
13973  Description:
13974  This function adds a data transfer characteristics for a DMA channel. The
13975  The source and the destination addresses, source and destination lengths,
13976  The number of bytes transferred per cell event are set. It also enables
13977  the channel to start data transfer.
13978  If the requesting client registered an event callback with the service,
13979  the service will issue a SYS_DMA_TRANSFER_EVENT_COMPLETE or
13980  SYS_DMA_TRANSFER_EVENT_ABORT event if the transfered was processed
13981  successfully of SYS_DMA_TRANSFER_EVENT_ERROR event if the transfer was not
13982  processed successfully.
13983  Precondition:
13984  DMA should have been initialized by calling SYS_DMA_Initialize.
13985  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13986  The function SYS_DMA_ChannelSetup must have been called to setup and
13987  enable the required features.
13988  Parameters:
13989  handle - Handle of the DMA channel as returned by the
13990  SYS_DMA_ChannelAllocate function.
13991  srcAddr - Source of the DMA transfer
13992  srcSize - Size of the source
13993  destAddr - Destination of the DMA transfer
13994  destSize - Size of the destination
13995  cellSize - Size of the cell
13996  Returns:
13997  None.
13998  Example:
13999  <code>
14000  // Add 10 bytes of data transfer to UART TX
14001  // 'handle' is a valid handle returned
14002  // by the SYS_DMA_ChannelAllocate function.
14003  MY_APP_OBJ myAppObj;
14004  uint8_t buf[10];
14005  void *srcAddr;
14006  void *destAddr;
14007  size_t srcSize;
14008  size_t destSize;
14009  size_t cellSize;
14010  srcAddr = (uint8_t *) buf;
14011  srcSize = 10;
14012  destAddr = (uin8_t*) &U2TXREG;
14013  destSize = 1;
14014  cellSize = 1;
14015  // User registers an event handler with system service. This is done once
14016  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14017  (uintptr_t)&myAppObj);
14018  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14019  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14020  {
14021  // Error handling here
14022  }
14023  // Event Processing Technique. Event is received when
14024  // the transfer is processed.
14025  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14026  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14027  {
14028  switch(event)
14029  {
14030  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14031  // This means the data was transferred.
14032  break;
14033  case SYS_DMA_TRANSFER_EVENT_ERROR:
14034  // Error handling here.
14035  break;
14036  default:
14037  break;
14038  }
14039  }
14040  </code>
14041  Remarks:
14042  For PIC32MZ series of devices, if the source/destination addresses are
14043  RAM memory addresses, the the source/destination buffers
14044  should be made coherent to avoid the cache coherency issues.
14045  For example:
14046  <code>
14047  uint8_t buffer[1024];
14048  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14049  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14050  </code>
14051 */
14052 
14053 void
14055  SYS_DMA_CHANNEL_HANDLE handle ,
14056  const void * srcAddr ,
14057  size_t srcSize ,
14058  const void * destAddr ,
14059  size_t destSize ,
14060  size_t cellSize ) ;
14061 //******************************************************************************
14062 /* Function:
14063  void SYS_DMA_ChannelTransferSet
14064  (
14065  SYS_DMA_CHANNEL_HANDLE handle,
14066  const void *srcAddr, size_t srcSize
14067  const void *destAddr, size_t destSize,
14068  size_t cellSize
14069  )
14070  Summary:
14071  Sets up a data transfer to a DMA channel.
14072  Description:
14073  This function sets up data transfer characteristics for a DMA channel. The
14074  The source and the destination addresses, source and destination lengths,
14075  The number of bytes transferred per cell event are set.
14076  This function does not enables the DMA channel. The channel has to be explicitly
14077  enabled to start the data transfer.
14078  The above functions could be used in situations where in the user intends to
14079  setup transfer parameters but do not intend to enable the channel immediately.
14080  For example to chain to DMA channels in a cyclic order where the channels remains
14081  disabled. The channel is enabled automatically by the DMA when the transfer trigger
14082  condition occurs.
14083  Precondition:
14084  DMA should have been initialized by calling SYS_DMA_Initialize.
14085  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14086  The function SYS_DMA_ChannelSetup must have been called to setup and
14087  enable the required features.
14088  Parameters:
14089  handle - Handle of the DMA channel as returned by the
14090  SYS_DMA_ChannelAllocate function.
14091  srcAddr - Source of the DMA transfer
14092  srcSize - Size of the source
14093  destAddr - Destination of the DMA transfer
14094  destSize - Size of the destination
14095  cellSize - Size of the cell
14096  Returns:
14097  None.
14098  Example:
14099  <code>
14100  // Set up 10 bytes of data transfer to UART TX
14101  // 'handle' is a valid handle returned
14102  // by the SYS_DMA_ChannelAllocate function.
14103  MY_APP_OBJ myAppObj;
14104  uint8_t buf[10];
14105  void *srcAddr;
14106  void *destAddr;
14107  size_t srcSize;
14108  size_t destSize;
14109  size_t cellSize;
14110  srcAddr = (uint8_t *) buf;
14111  srcSize = 10;
14112  destAddr = (uin8_t*) &U2TXREG;
14113  destSize = 1;
14114  cellSize = 1;
14115  // User registers an event handler with system service. This is done once
14116  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14117  (uintptr_t)&myAppObj);
14118  SYS_DMA_ChannelTransferSet(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14119  SYS_DMA_ChannelEnable(handle);
14120  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14121  {
14122  // Error handling here
14123  }
14124  // Event Processing Technique. Event is received when
14125  // the transfer is processed.
14126  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14127  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14128  {
14129  switch(event)
14130  {
14131  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14132  // This means the data was transferred.
14133  break;
14134  case SYS_DMA_TRANSFER_EVENT_ERROR:
14135  // Error handling here.
14136  break;
14137  default:
14138  break;
14139  }
14140  }
14141  </code>
14142  Remarks:
14143  For PIC32MZ series of devices, if the source/destination addresses are
14144  RAM memory addresses, the the source/destination buffers
14145  should be made coherent to avoid the cache coherency issues.
14146  For example:
14147  <code>
14148  uint8_t buffer[1024];
14149  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14150  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14151  </code>
14152 */
14153 
14154 void
14156  SYS_DMA_CHANNEL_HANDLE handle ,
14157  const void * srcAddr ,
14158  size_t srcSize ,
14159  const void * destAddr ,
14160  size_t destSize ,
14161  size_t cellSize ) ;
14162 //******************************************************************************
14163 /* Function:
14164  size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14165  Summary:
14166  Returns the number of bytes transferred from source.
14167  Description:
14168  When a data transfer request is submitted. At any time while the transmission
14169  is in progress the size of the amount of data transferred from source
14170  can be known by calling this function.
14171  Precondition:
14172  DMA should have been initialized by calling SYS_DMA_Initialize.
14173  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14174  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14175  SYS_DMA_ChannelTransferSet.
14176  Parameters:
14177  handle - A valid channel handle, returned from the system service's
14178  Allocate routine
14179  Returns:
14180  size_t - Returns the number of bytes transferred from the submitted size.
14181  Example:
14182  <code>
14183  // 'handle' is a valid handle returned
14184  // by the SYS_DMA_ChannelAllocate function.
14185  MY_APP_OBJ myAppObj;
14186  uint8_t buf[10];
14187  void *srcAddr;
14188  void *destAddr;
14189  size_t srcSize;
14190  size_t destSize;
14191  size_t cellSize;
14192  size_t transferredSize;
14193  srcAddr = (uint8_t *) buf;
14194  srcSize = 10;
14195  destAddr = (uin8_t*) &U2TXREG;
14196  destSize = 1;
14197  cellSize = 1;
14198  channelHandle = SYS_DMA_ChannelAllocate(channel);
14199  // User registers an event handler with system service. This is done once
14200  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14201  (uintptr_t)&myAppObj);
14202  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14203  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14204  {
14205  // Error handling here
14206  }
14207  // The data is being transferred after adding the transfer to the DMA channel.
14208  // The user can get to know dynamically the amount of data
14209  // transmitted from source by calling SYS_DMA_ChannelSourceTransferredSizeGet
14210  transferredSize = SYS_DMA_ChannelSourceTransferredSizeGet(channelHandle);
14211  </code>
14212  Remarks:
14213  None.
14214 */
14215 
14216 size_t
14218  SYS_DMA_CHANNEL_HANDLE handle ) ;
14219 //******************************************************************************
14220 /* Function:
14221  size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14222  Summary:
14223  Returns the number of bytes transferred to destination.
14224  Description:
14225  When a data transfer request is submitted. At any time while the transmission
14226  is in progress the size of the amount of data transferred to destination
14227  can be known by calling this function.
14228  Precondition:
14229  DMA should have been initialized by calling SYS_DMA_Initialize.
14230  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14231  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14232  SYS_DMA_ChannelTransferSet.
14233  Parameters:
14234  handle - A valid channel handle, returned from the system service's
14235  Allocate routine
14236  Returns:
14237  size_t - Returns the number of bytes received from the submitted size.
14238  Example:
14239  <code>
14240  // 'handle' is a valid handle returned
14241  // by the SYS_DMA_ChannelAllocate function.
14242  MY_APP_OBJ myAppObj;
14243  uint8_t buf[10];
14244  void *srcAddr;
14245  void *destAddr;
14246  size_t srcSize;
14247  size_t destSize;
14248  size_t cellSize;
14249  size_t transferredSize;
14250  srcAddr = (uin8_t*) &U2RXREG;
14251  srcSize = 1;
14252  destAddr = (uint8_t *) buf ;
14253  destSize = 10;
14254  cellSize = 1;
14255  channelHandle = SYS_DMA_ChannelAllocate(channel);
14256  // User registers an event handler with system service. This is done once
14257  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14258  (uintptr_t)&myAppObj);
14259  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14260  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14261  {
14262  // Error handling here
14263  }
14264  // The data is being transferred after adding the transfer to the DMA channel.
14265  // The user can get to know dynamically the amount of data
14266  // transmitted to destination by calling SYS_DMA_ChannelDestinationTransferredSizeGet
14267  transferredSize = SYS_DMA_ChannelDestinationTransferredSizeGet(channelHandle);
14268  </code>
14269  Remarks:
14270  None.
14271 */
14272 
14273 size_t
14275  SYS_DMA_CHANNEL_HANDLE handle ) ;
14276 //******************************************************************************
14277 /*
14278  Function:
14279  void SYS_DMA_ChannelTransferEventHandlerSet
14280  (
14281  SYS_DMA_CHANNEL_HANDLE handle,
14282  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler,
14283  const uintptr_t contextHandle
14284  )
14285  Summary:
14286  This function allows a DMA system service client to set an event handler.
14287  Description:
14288  This function allows a client to set an event handler. The client may want
14289  to receive transfer related events in cases when it uses non-blocking read and
14290  write functions. The event handler should be set before the client
14291  intends to perform operations that could generate events.
14292  This function accepts a contextHandle parameter. This parameter could be
14293  set by the client to contain (or point to) any client specific data object
14294  that should be associated with this DMA channel.
14295  Precondition:
14296  DMA should have been initialized by calling SYS_DMA_Initialize.
14297  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14298  Parameters:
14299  handle - A valid channel handle, returned from the system service's
14300  Allocate routine
14301  eventHandler - Pointer to the event handler function.
14302  contextHandle - Value identifying the context of the application/driver/middleware
14303  that registered the event handling function.
14304  Returns:
14305  None.
14306  Example:
14307  <code>
14308  // 'handle' is a valid handle returned
14309  // by the SYS_DMA_ChannelAllocate function.
14310  MY_APP_OBJ myAppObj;
14311  uint8_t buf[10];
14312  void *srcAddr;
14313  void *destAddr;
14314  size_t srcSize;
14315  size_t destSize;
14316  size_t cellSize;
14317  srcAddr = (uint8_t *) buf;
14318  srcSize = 10;
14319  destAddr = (uin8_t*) &U2TXREG;
14320  destSize = 1;
14321  cellSize = 1;
14322  channelHandle = SYS_DMA_ChannelAllocate(channel);
14323  // User registers an event handler with system service. This is done once
14324  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14325  (uintptr_t)&myAppObj);
14326  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14327  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14328  {
14329  // Error handling here
14330  }
14331  // Event Processing Technique. Event is received when
14332  // the transfer is processed.
14333  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14334  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14335  {
14336  switch(event)
14337  {
14338  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14339  // This means the data was transferred.
14340  break;
14341  case SYS_DMA_TRANSFER_EVENT_ERROR:
14342  // Error handling here.
14343  break;
14344  default:
14345  break;
14346  }
14347  }
14348  </code>
14349  Remarks:
14350  None.
14351  */
14352 
14353 void
14355  SYS_DMA_CHANNEL_HANDLE handle ,
14356  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler ,
14357  const uintptr_t contextHandle ) ;
14358 // *****************************************************************************
14359 /* Function:
14360  SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
14361  Summary:
14362  This function returns the error(if any) associated with the last client
14363  request.
14364  Description:
14365  This function returns the error(if any) associated with the last client
14366  request. If the service send a SYS_DMA_TRANSFER_EVENT_ERROR to the client,
14367  the client can call this function to know the error cause.
14368  The error status will be updated on every operation and should be read
14369  frequently (ideally immediately after the service operation has completed)
14370  to know the relevant error status.
14371  Precondition:
14372  The SYS_DMA_Initialize routine must have been called for the DMA sub system.
14373  SYS_DMA_ChannelAllocate must have been called to obtain a valid opened channel
14374  handle.
14375  Parameters:
14376  handle - Handle of the DMA channel as returned by the
14377  SYS_DMA_ChannelAllocate function.
14378  Returns:
14379  A SYS_DMA_ERROR type indicating last known error status.
14380  Example:
14381  <code>
14382  // 'handle' is a valid handle returned
14383  // by the SYS_DMA_ChannelAllocate function.
14384  // pDmaSrc, pDmaDst is the source,destination address
14385  // txferSrcSize, txferDesSize is the source,destination transfer size
14386  // cellSize is the cell size
14387  MY_APP_OBJ myAppObj;
14388  // Client registers an event handler with service. This is done once
14389  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14390  (uintptr_t)&myAppObj );
14391  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14392  DMA_TRIGGER_SOURCE_NONE);
14393  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14394  pDmaDst,txferDesSize,cellSize);
14395  SYS_DMA_ChannelForceStart(handle);
14396  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14397  {
14398  // Error handling here
14399  }
14400  // Event Processing Technique. Event is received when
14401  // the transfer is processed.
14402  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14403  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14404  {
14405  switch(event)
14406  {
14407  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14408  // This means the data was transferred.
14409  break;
14410  case SYS_DMA_TRANSFER_EVENT_ERROR:
14411  // Error handling here.
14412  if(SYS_DMA_ERROR_ADDRESS_ERROR == SYS_DMA_ChannelErrorGet(handle))
14413  {
14414  // There was an address error.
14415  // Do error handling here.
14416  }
14417  break;
14418  default:
14419  break;
14420  }
14421  }
14422  </code>
14423  Remarks:
14424  It is the client's responsibility to make sure that the error status is
14425  obtained frequently. The service will update the error status
14426  regardless of whether this has been examined by the client.
14427 */
14428 
14431  SYS_DMA_CHANNEL_HANDLE handle ) ;
14432 //******************************************************************************
14433 /* Function:
14434  void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
14435  Summary:
14436  Force start of transfer on the selected channel.
14437  Description:
14438  The function force start a DMA transfer to occur for the selected channel.
14439  Precondition:
14440  DMA should have been initialized by calling SYS_DMA_Initialize.
14441  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14442  The function SYS_DMA_ChannelSetup must have been called to setup and
14443  enable the required features.
14444  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14445  Parameters:
14446  handle - Handle of the DMA channel as returned by the
14447  SYS_DMA_ChannelAllocate function.
14448  Returns:
14449  None.
14450  Example:
14451  <code>
14452  // 'handle' is a valid handle returned
14453  // by the SYS_DMA_ChannelAllocate function.
14454  // pDmaSrc, pDmaDst is the source,destination address
14455  // txferSrcSize, txferDesSize is the source,destination transfer size
14456  // cellSize is the cell size
14457  MY_APP_OBJ myAppObj;
14458  // Client registers an event handler with service. This is done once
14459  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14460  (uintptr_t)&myAppObj );
14461  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14462  DMA_TRIGGER_SOURCE_NONE);
14463  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14464  pDmaDst,txferDesSize,cellSize);
14465  SYS_DMA_ChannelForceStart(handle);
14466  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14467  {
14468  // Error handling here
14469  }
14470  // Event Processing Technique. Event is received when
14471  // the transfer is processed.
14472  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14473  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14474  {
14475  switch(event)
14476  {
14477  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14478  // This means the data was transferred.
14479  break;
14480  case SYS_DMA_TRANSFER_EVENT_ERROR:
14481  // Error handling here.
14482  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14483  {
14484  // There was an address error.
14485  // Do error handling here.
14486  }
14487  break;
14488  default:
14489  break;
14490  }
14491  }
14492  </code>
14493  Remarks:
14494  This function must be used to start the DMA transfer when the channel has been
14495  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14496 */
14497 
14498 void
14500  SYS_DMA_CHANNEL_HANDLE handle ) ;
14501 //******************************************************************************
14502 /* Function:
14503  void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
14504  Summary:
14505  Force abort of transfer on the selected channel.
14506  Description:
14507  The function aborts a DMA transfer to occur for the selected channel.
14508  Precondition:
14509  DMA should have been initialized by calling SYS_DMA_Initialize.
14510  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14511  The function SYS_DMA_ChannelSetup must have been called to setup and
14512  enable the required features.
14513  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14514  Parameters:
14515  handle - Handle of the DMA channel as returned by the
14516  SYS_DMA_ChannelAllocate function.
14517  Returns:
14518  None.
14519  Example:
14520  <code>
14521  // 'handle' is a valid handle returned
14522  // by the SYS_DMA_ChannelAllocate function.
14523  // pDmaSrc, pDmaDst is the source,destination address
14524  // txferSrcSize, txferDesSize is the source,destination transfer size
14525  // cellSize is the cell size
14526  MY_APP_OBJ myAppObj;
14527  // Client registers an event handler with service. This is done once
14528  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14529  (uintptr_t)&myAppObj );
14530  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14531  DMA_TRIGGER_SOURCE_NONE);
14532  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14533  pDmaDst,txferDesSize,cellSize);
14534  SYS_DMA_ChannelForceStart(handle);
14535  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14536  {
14537  // Error handling here
14538  }
14539  ....
14540  ....
14541  // Client may need to abort a transfer
14542  SYS_DMA_ChannelForceAbort(handle);
14543  // Event Processing Technique. Event is received when
14544  // the transfer is processed.
14545  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14546  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14547  {
14548  switch(event)
14549  {
14550  case SYS_DMA_TRANSFER_EVENT_ABORT:
14551  // This means the data was transferred.
14552  break;
14553  case SYS_DMA_TRANSFER_EVENT_ERROR:
14554  // Error handling here.
14555  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14556  {
14557  // There was an address error.
14558  // Do error handling here.
14559  }
14560  break;
14561  default:
14562  break;
14563  }
14564  }
14565  </code>
14566  Remarks:
14567  This function must be used to abort the DMA transfer when the channel has been
14568  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14569  and SYS_DMA_ChannelAbortEventSet has not been called.
14570 */
14571 
14572 void
14574  SYS_DMA_CHANNEL_HANDLE handle ) ;
14575 //******************************************************************************
14576 /* Function:
14577  void SYS_DMA_ChannelAbortEventSet
14578  (
14579  SYS_DMA_CHANNEL_HANDLE handle,
14580  DMA_TRIGGER_SOURCE eventSrc
14581  )
14582  Summary:
14583  Sets an event source and enables cell transfer abort event for the same
14584  for the selected channel.
14585  Description:
14586  This functions enables a cell transfer abort event for the selected source
14587  event.
14588  Precondition:
14589  DMA should have been initialized by calling SYS_DMA_Initialize.
14590  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14591  The function SYS_DMA_ChannelSetup must have been called to setup and
14592  enable the required features.
14593  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14594  Parameters:
14595  handle - Handle of the DMA channel as returned by the
14596  SYS_DMA_ChannelAllocate function.
14597  eventSrc - The event causing the cell transfer abort
14598  Returns:
14599  None.
14600  Example:
14601  <code>
14602  // 'handle' is a valid handle returned
14603  // by the SYS_DMA_ChannelAllocate function.
14604  // pDmaSrc, pDmaDst is the source,destination address
14605  // txferSrcSize, txferDesSize is the source,destination transfer size
14606  // cellSize is the cell size
14607  MY_APP_OBJ myAppObj;
14608  // Client registers an event handler with service. This is done once
14609  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14610  (uintptr_t)&myAppObj );
14611  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14612  DMA_TRIGGER_SOURCE_NONE);
14613  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14614  pDmaDst,txferDesSize,cellSize);
14615  SYS_DMA_ChannelAbortEventSet(handle, DMA_TRIGGER_CTMU);
14616  SYS_DMA_ChannelForceStart(handle);
14617  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14618  {
14619  // Error handling here
14620  }
14621  // Event Processing Technique. Event is received when
14622  // the transfer is processed.
14623  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14624  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14625  {
14626  switch(event)
14627  {
14628  case SYS_DMA_TRANSFER_EVENT_ABORT:
14629  // This means the data was transferred.
14630  break;
14631  case SYS_DMA_TRANSFER_EVENT_ERROR:
14632  // Error handling here.
14633  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14634  {
14635  // There was an address error.
14636  // Do error handling here.
14637  }
14638  break;
14639  default:
14640  break;
14641  }
14642  }
14643  </code>
14644  Remarks:
14645  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE the
14646  current DMA transfer will be aborted. The behavior is a same as calling
14647  SYS_DMA_ChannelForceAbort.
14648 */
14649 
14650 void
14652  SYS_DMA_CHANNEL_HANDLE handle ,
14653  DMA_TRIGGER_SOURCE eventSrc ) ;
14654 //******************************************************************************
14655 /* Function:
14656  bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
14657  Summary:
14658  Returns the busy status of the specified DMA channel.
14659  Description:
14660  This function returns the busy status of the selected DMA channel
14661  Precondition:
14662  DMA should have been initialized by calling SYS_DMA_Initialize.
14663  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14664  Parameters:
14665  handle - Handle of the DMA channel as returned by the
14666  SYS_DMA_ChannelAllocate function.
14667  Returns:
14668  bool - true, if the selected DMA channel is active or enabled
14669  - false, if the selected DMA channel is inactive or disabled
14670  Example:
14671  <code>
14672  bool busyStat;
14673  busyStat = SYS_DMA_ChannelGetBusy(handle);
14674  </code>
14675  Remarks:
14676  This feature may not be available on all devices. Refer to the specific device
14677  data sheet to determine availability.
14678 */
14679 
14680 bool
14682  SYS_DMA_CHANNEL_HANDLE handle ) ;
14683 //******************************************************************************
14684 /* Function:
14685  void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
14686  Summary:
14687  Suspend DMA operation on the specified DMA channel.
14688  Description:
14689  This function suspends the DMA operation on the DMA channel
14690  specified by the channel handle.
14691  Precondition:
14692  DMA should have been initialized by calling SYS_DMA_Initialize.
14693  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14694  Parameters:
14695  handle - Handle of the DMA channel as returned by the
14696  SYS_DMA_ChannelAllocate function.
14697  Returns:
14698  None.
14699  Example:
14700  <code>
14701  SYS_DMA_ChannelSuspend(handle);
14702  </code>
14703  Remarks:
14704  This feature may not be available on all devices. Refer to the specific device
14705  data sheet to determine availability.
14706 */
14707 
14708 void
14710  SYS_DMA_CHANNEL_HANDLE handle ) ;
14711 //******************************************************************************
14712 /* Function:
14713  void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
14714  Summary:
14715  Resume DMA operation on the specified DMA channel.
14716  Description:
14717  This function resumes the DMA operation on the DMA channel
14718  specified by the channel handle.
14719  Precondition:
14720  DMA should have been initialized by calling SYS_DMA_Initialize.
14721  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14722  Parameters:
14723  handle - Handle of the DMA channel as returned by the
14724  SYS_DMA_ChannelAllocate function.
14725  Returns:
14726  None.
14727  Example:
14728  <code>
14729  SYS_DMA_ChannelResume(handle);
14730  </code>
14731  Remarks:
14732  This feature may not be available on all devices. Refer to the specific device
14733  data sheet to determine availability.
14734 */
14735 
14736 void
14738  SYS_DMA_CHANNEL_HANDLE handle ) ;
14739 // *****************************************************************************
14740 // *****************************************************************************
14741 // Section: Global DMA Management Functions
14742 // *****************************************************************************
14743 // *****************************************************************************
14744 //******************************************************************************
14745 /* Function:
14746  void SYS_DMA_Suspend(void)
14747  Summary:
14748  Suspend DMA transfers.
14749  Description:
14750  This function suspends DMA transfers to allow CPU uninterrupted access
14751  to data bus
14752  Precondition:
14753  DMA should have been initialized by calling SYS_DMA_Initialize.
14754  Parameters:
14755  None.
14756  Returns:
14757  None.
14758  Example:
14759  <code>
14760  SYS_DMA_Suspend();
14761  </code>
14762  Remarks:
14763  None
14764 */
14765 
14766 void
14767  SYS_DMA_Suspend ( void ) ;
14768 //******************************************************************************
14769 /* Function:
14770  void SYS_DMA_Resume(void)
14771  Summary:
14772  Resume DMA operations.
14773  Description:
14774  This function disables DMA suspend. It resumes the DMA operation suspended
14775  by calling SYS_DMA_Suspend. The DMA operates normally.
14776  Precondition:
14777  DMA should have been initialized by calling SYS_DMA_Initialize.
14778  Parameters:
14779  None.
14780  Returns:
14781  None.
14782  Example:
14783  <code>
14784  SYS_DMA_Resume();
14785  </code>
14786  Remarks:
14787  None
14788 */
14789 
14790 void
14791  SYS_DMA_Resume ( void ) ;
14792 //******************************************************************************
14793 /* Function:
14794  bool SYS_DMA_IsBusy(void)
14795  Summary:
14796  Returns the busy status of the DMA module.
14797  Description:
14798  This function returns the busy status of the DMA module
14799  Precondition:
14800  DMA should have been initialized by calling SYS_DMA_Initialize.
14801  Parameters:
14802  None.
14803  Returns:
14804  Boolean
14805  - true - The DMA module is active
14806  - false - The DMA module is inactive and disabled
14807  <code>
14808  bool busyStat;
14809  busyStat = SYS_DMA_IsBusy();
14810  </code>
14811  Remarks:
14812  This feature may not be available on all devices. Refer to the specific device
14813  data sheet to determine availability.
14814 */
14815 
14816 bool
14817  SYS_DMA_IsBusy ( void ) ;
14818 // *****************************************************************************
14819 // *****************************************************************************
14820 // Section: Deprecated functions
14821 // *****************************************************************************
14822 // *****************************************************************************
14823 //*******************************************************************************
14824 /* Function:
14825  void SYS_DMA_TasksISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
14826  Summary:
14827  This function is deprecated. Use SYS_DMA_Tasks function.
14828  */
14829 
14830 void
14831  SYS_DMA_Tasks (
14832  SYS_MODULE_OBJ object ,
14833  DMA_CHANNEL activeChannel ) ;
14834 //*****************************************************************************
14835 /* Function:
14836  void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
14837  Summary:
14838  This function is deprecated. Use SYS_DMA_Tasks function.
14839  */
14840 
14841 void
14843  SYS_MODULE_OBJ object ) ;
14844 //*******************************************************************************
14845 /* Function:
14846  void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
14847  Summary:
14848  This function is deprecated. Use SYS_DMA_Tasks function.
14849  */
14850 
14851 void
14853  SYS_MODULE_OBJ object ,
14854  DMA_CHANNEL activeChannel ) ;
14855  // #ifndef _SYS_DMA_H
14856 /*******************************************************************************
14857  End of File
14858 */
14859 
14860 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h*/
14861 /* CLOSE_FILE Include File */
14862 
14863 // DOM-IGNORE-BEGIN
14864 // DOM-IGNORE-END
14865 // *****************************************************************************
14866 // *****************************************************************************
14867 // Section: Data Types
14868 // *****************************************************************************
14869 // *****************************************************************************
14870 // *****************************************************************************
14871 /* Driver USART Module Index
14872  Summary:
14873  USART driver index definitions
14874  Description:
14875  These constants provide USART driver index definitions.
14876  Remarks:
14877  These constants should be used in place of hard-coded numeric literals.
14878  These values should be passed into the DRV_USART_Initialize and
14879  DRV_USART_Open routines to identify the driver instance in use.
14880 */
14881 #define DRV_USART_INDEX_0 0
14882 #define DRV_USART_INDEX_1 1
14883 #define DRV_USART_INDEX_2 2
14884 #define DRV_USART_INDEX_3 3
14885 #define DRV_USART_INDEX_4 4
14886 #define DRV_USART_INDEX_5 5
14887 // *****************************************************************************
14888 /* USART Driver Module Count
14889  Summary:
14890  Number of valid USART drivers
14891  Description:
14892  This constant identifies the maximum number of USART Driver instances that
14893  should be defined in the system. Defining more instances than this
14894  constant will waste RAM memory space.
14895  This constant can also be used by the system and application to identify the
14896  number of USART instances on this microcontroller.
14897  Remarks:
14898  This value is part-specific.
14899 */
14900 #define DRV_USART_COUNT USART_NUMBER_OF_MODULES
14901 // *****************************************************************************
14902 /* USART Driver Write Error
14903  Summary:
14904  USART Driver Write Error.
14905  Description:
14906  This constant is returned by DRV_USART_Write() function when an error
14907  occurs.
14908  Remarks:
14909  None.
14910 */
14911 #define DRV_USART_WRITE_ERROR ( ( uint32_t ) ( - 1 ) )
14912 // *****************************************************************************
14913 /* USART Driver Read Error
14914  Summary:
14915  USART Driver Read Error.
14916  Description:
14917  This constant is returned by DRV_USART_Read() function when an error
14918  occurs.
14919  Remarks:
14920  None.
14921 */
14922 #define DRV_USART_READ_ERROR ( ( uint32_t ) ( - 1 ) )
14923 // *****************************************************************************
14924 /* USART Driver Buffer Handle
14925  Summary:
14926  Handle identifying a read or write buffer passed to the driver.
14927  Description:
14928  A buffer handle value is returned by a call to the DRV_USART_BufferAddRead
14929  or DRV_USART_BufferAddWrite functions. This handle is associated with the
14930  buffer passed into the function and it allows the application to track the
14931  completion of the data from (or into) that buffer. The buffer handle value
14932  returned from the "buffer add" function is returned back to the client
14933  by the "event handler callback" function registered with the driver.
14934  The buffer handle assigned to a client request expires when the client has
14935  been notified of the completion of the buffer transfer (after event handler
14936  function that notifies the client returns) or after the buffer has been
14937  retired by the driver if no event handler callback was set.
14938  Remarks:
14939  None
14940 */
14941 
14942 typedef
14943 uintptr_t
14945 // *****************************************************************************
14946 /* USART Driver Invalid Buffer Handle
14947  Summary:
14948  Definition of an invalid buffer handle.
14949  Description:
14950  This is the definition of an invalid buffer handle. An invalid buffer handle
14951  is returned by DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite
14952  functions if the buffer add request was not successful.
14953  Remarks:
14954  None
14955 */
14956 #define DRV_USART_BUFFER_HANDLE_INVALID ( ( DRV_USART_BUFFER_HANDLE ) ( - 1 ) )
14957 // *****************************************************************************
14958 /* USART Modes of Operation
14959  Summary:
14960  Identifies the modes of the operation of the USART module
14961  Description:
14962  This data type identifies the modes of the operation of the USART module.
14963  Remarks:
14964  Not all modes are available on all devices. Refer to the specific device data
14965  sheet to determine availability.
14966 */
14967 
14968 typedef
14969  enum
14970  {
14971  /* USART works in IRDA mode */
14973  /* This is the normal point to point communication mode where the USART
14974  communicates directly with another USART by connecting it's Transmit signal
14975  to the external USART's Receiver signal and vice versa. An external
14976  transceiver may be connected to obtain RS-232 signal levels. This type of
14977  connection is typically full duplex. */
14979  /* This is a multi-point bus mode where the USART can communicate with
14980  many other USARTS on a bus using an address-based protocol such as RS-485.
14981  This mode is typically half duplex and the physical layer may require a
14982  transceiver. In this mode every USART on the bus is assigned an address and
14983  the number of data bits is 9 bits */
14985  /* Loopback mode internally connects the Transmit signal to the Receiver
14986  signal, looping data transmission back into this USART's own input. It is
14987  useful primarily as a test mode. */
14990 // *****************************************************************************
14991 /* USART Driver Buffer Events
14992  Summary
14993  Identifies the possible events that can result from a buffer add request.
14994  Description
14995  This enumeration identifies the possible events that can result from a
14996  buffer add request caused by the client calling either the
14997  DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite functions.
14998  Remarks:
14999  One of these values is passed in the "event" parameter of the event
15000  handling callback function that the client registered with the driver by
15001  calling the DRV_USART_BufferEventHandlerSet function when a buffer
15002  transfer request is completed.
15003 */
15004 
15005 typedef
15006  enum
15007  {
15008  /* All data from or to the buffer was transferred successfully. */
15010  /* There was an error while processing the buffer transfer request. */
15012  /* Data transfer aborted (Applicable in DMA mode) */
15015 // *****************************************************************************
15016 /* USART Driver Buffer Result
15017  Summary
15018  Identifies the possible result of the buffer processing.
15019  Description
15020  This enumeration identifies the possible result of the buffer processing.
15021 
15022  Remarks:
15023  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED is the state of the buffer which
15024  is in the free buffer pool.
15025 */
15026 
15027 typedef
15028  enum
15029  {
15030  /* Buffer handle is not valid*/
15032  /* Buffer handle has expired. */
15034  /* Buffer is removed from the queue succesfully*/
15036  /* Buffer removal failed because of unable to acquire the mutex
15037  * This is applicable in RTOS mode only */
15040 // *****************************************************************************
15041 /* USART Driver Buffer Event Handler Function Pointer
15042  Summary
15043  Pointer to a USART Driver Buffer Event handler function
15044  Description
15045  This data type defines the required function signature for the USART driver
15046  buffer event handling callback function. A client must register a pointer
15047  to a buffer event handling function whose function signature (parameter
15048  and return value types) match the types specified by this function pointer
15049  in order to receive buffer related event calls back from the driver.
15050  The parameters and return values and are described here and
15051  a partial example implementation is provided.
15052  Parameters:
15053  event - Identifies the type of event
15054  bufferHandle - Handle identifying the buffer to which the vent relates
15055  context - Value identifying the context of the application that registered
15056  the event handling function.
15057  Returns:
15058  None.
15059  Example:
15060  <code>
15061  void APP_MyBufferEventHandler( DRV_USART_BUFFER_EVENT event,
15062  DRV_USART_BUFFER_HANDLE bufferHandle,
15063  uintptr_t context )
15064  {
15065  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
15066  switch(event)
15067  {
15068  case DRV_USART_BUFFER_EVENT_COMPLETE:
15069  // Handle the completed buffer.
15070  break;
15071  case DRV_USART_BUFFER_EVENT_ERROR:
15072  default:
15073  // Handle error.
15074  break;
15075  }
15076  }
15077  </code>
15078  Remarks:
15079  If the event is DRV_USART_BUFFER_EVENT_COMPLETE, it means that the data was
15080  transferred successfully.
15081  If the event is DRV_USART_BUFFER_EVENT_ERROR, it means that the data was not
15082  transferred successfully. The DRV_USART_ErrorGet function can be called to
15083  know the error. The DRV_USART_BufferCompletedBytesGet function can be
15084  called to find out how many bytes were processed.
15085  The bufferHandle parameter contains the buffer handle of the buffer that
15086  associated with the event.
15087  The context parameter contains the a handle to the client context,
15088  provided at the time the event handling function was registered using the
15089  DRV_USART_BufferEventHandlerSet function. This context handle value is
15090  passed back to the client as the "context" parameter. It can be any value
15091  necessary to identify the client context or instance (such as a pointer to
15092  the client's data) instance of the client that made the buffer add request.
15093  The event handler function executes in the driver peripheral's interrupt
15094  context when the driver is configured for interrupt mode operation. It is
15095  recommended of the application to not perform process intensive or blocking
15096  operations with in this function.
15097  The DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite functions can
15098  be called in the event handler to add a buffer to the driver queue. These
15099  functions can only be called to add buffers to the driver whose event
15100  handler is running. For example, buffers cannot be added USART2 driver in
15101  USART1 driver event handler.
15102 */
15103 
15104 typedef
15106 DRV_USART_BUFFER_HANDLE bufferHandle ,
15107 uintptr_t context ) ;
15108 // *****************************************************************************
15109 /* USART Driver Byte Event Handler Function Pointer
15110  Summary
15111  Pointer to a USART Driver Byte Event handler function
15112  Description
15113  This data type defines the required function signature for the USART driver
15114  byte event handling callback function. A client must register a pointer to a
15115  byte event handling function whose function signature (parameter and return
15116  value types) match the types specified by this function pointer in order to
15117  receive byte related event calls back from the driver.
15118  Parameters:
15119  index - Identifier for the instance
15120  Returns:
15121  None.
15122  Example:
15123  <code>
15124  void APP_MyUsartTxEventHandler(void)
15125  {
15126  // Handle the transmit byte event
15127  }
15128  </code>
15129  Remarks:
15130  The event handler function executes in the driver peripheral's interrupt
15131  context when the driver is configured for interrupt mode operation. It is
15132  recommended that the application not perform process intensive or blocking
15133  operations with in this function.
15134 */
15135 
15136 typedef
15137 void ( * DRV_USART_BYTE_EVENT_HANDLER ) ( const SYS_MODULE_INDEX index ) ;
15138 // *****************************************************************************
15139 /* USART Handshake Modes
15140  Summary:
15141  Identifies the handshaking modes supported by the USART driver.
15142  Description:
15143  This data type identifies the handshaking modes supported by the USART
15144  driver.
15145  Remarks:
15146  Not all modes are available on all devices. Refer to the specific device data
15147  sheet to determine availability.
15148 */
15149 
15150 typedef
15151  enum
15152  {
15153  /* Handshaking occurs in Flow Control Mode */
15154  DRV_USART_HANDSHAKE_FLOWCONTROL = /*DOM-IGNORE-BEGIN*/
15155  USART_HANDSHAKE_MODE_FLOW_CONTROL /*DOM-IGNORE-END*/
15156  ,
15157  /* Handshaking occurs in Simplex Mode */
15158  DRV_USART_HANDSHAKE_SIMPLEX = /*DOM-IGNORE-BEGIN*/
15159  USART_HANDSHAKE_MODE_SIMPLEX /*DOM-IGNORE-END*/
15160  ,
15161  /* No Handshaking */
15162  DRV_USART_HANDSHAKE_NONE = /*DOM-IGNORE-BEGIN*/
15163  2 /*DOM-IGNORE-END*/
15165 // *****************************************************************************
15166 /* USART Baud Set Result
15167  Summary:
15168  Identifies the results of the baud set function.
15169  Description:
15170  This data type identifies the results of the DRV_USART_BaudSet function.
15171  Remarks:
15172  None.
15173 */
15174 
15175 typedef
15176  enum
15177  {
15178  /* The driver was not able to change the baud */
15179  DRV_USART_BAUD_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15180  - 1 /*DOM-IGNORE-END*/
15181  ,
15182  /* The driver was able to change the baud successfully */
15185 // *****************************************************************************
15186 /* USART Line Control Set Result
15187  Summary:
15188  Identifies the results of the baud set function.
15189  Description:
15190  This data type identifies the results of the DRV_USART_LineControlSet
15191  function.
15192  Remarks:
15193  None.
15194 */
15195 
15196 typedef
15197  enum
15198  {
15199  /* The driver was not able to change the Line Control */
15200  DRV_USART_LINE_CONTROL_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15201  - 1 /*DOM-IGNORE-END*/
15202  ,
15203  /* The driver was able to change the Line Control successfully */
15206 // *****************************************************************************
15207 /* USART Line Control Modes
15208  Summary:
15209  Identifies the line control modes supported by the USART driver.
15210  Description:
15211  This data type identifies the line control modes supported by the USART
15212  driver. Line control modes define the number of data bits, parity mode, and
15213  the number of stop bits in a USART transmit and receive frames.
15214  Remarks:
15215  The abbreviations used in the labels for the values of this enumeration
15216  follow the format <data><parity><stop>, where:
15217  <data> is the number of data bits
15218  <parity> is either "NONE" (for no parity), "EVEN" for 1 parity bit
15219  added to obtain an even number of bits, or "ODD" for one bit
15220  added to obtain an odd number of bits.
15221  <stop> is the number of Stop bits
15222 */
15223 
15224 typedef
15225  enum
15226  {
15227  /* 8 data bits, no parity bit, 1 stop bit */
15228  DRV_USART_LINE_CONTROL_8NONE1 = /*DOM-IGNORE-BEGIN*/
15229  USART_8N1 /* DOM-IGNORE-END*/
15230  ,
15231  /* 9 data bits, no parity bit, 1 stop bit */
15232  DRV_USART_LINE_CONTROL_9NONE1 = /*DOM-IGNORE-BEGIN*/
15233  USART_9N1 /* DOM-IGNORE-END*/
15234  ,
15235  /* 8 data bits, 1 bit for even parity, 1 stop bit */
15236  DRV_USART_LINE_CONTROL_8EVEN1 = /*DOM-IGNORE-BEGIN*/
15237  USART_8E1 /* DOM-IGNORE-END*/
15238  ,
15239  /* 8 data bits, 1 bit for even parity, 2 stop bits */
15240  DRV_USART_LINE_CONTROL_8EVEN2 = /*DOM-IGNORE-BEGIN*/
15241  USART_8E2 /* DOM-IGNORE-END*/
15242  ,
15243  /* 8 data bits, 1 bit for odd parity, 1 stop bit */
15244  DRV_USART_LINE_CONTROL_8ODD1 = /*DOM-IGNORE-BEGIN*/
15245  USART_8O1 /* DOM-IGNORE-END*/
15246  ,
15247  /* 8 data bits, 1 bit for odd parity, 2 stop bits */
15248  DRV_USART_LINE_CONTROL_8ODD2 = /*DOM-IGNORE-BEGIN*/
15249  USART_8O2 /* DOM-IGNORE-END*/
15250  ,
15251  /* 8 data bits, no parity bit, 2 stop bit */
15252  DRV_USART_LINE_CONTROL_8NONE2 = /*DOM-IGNORE-BEGIN*/
15253  USART_8N2 /* DOM-IGNORE-END*/
15254  ,
15255  /* 9 data bits, no parity bit, 2 stop bit */
15256  DRV_USART_LINE_CONTROL_9NONE2 = /*DOM-IGNORE-BEGIN*/
15257  USART_9N2 /* DOM-IGNORE-END*/
15259 // *****************************************************************************
15260 /* USART Initialization flags
15261  Summary:
15262  Flags identifying features that can be enabled when the driver is
15263  initialized.
15264  Description:
15265  This enumeration defines flags identifying features that can be enabled
15266  when the driver is initialized.
15267  Remarks:
15268  These flags can be logically ORed together. They are passed into the
15269  DRV_USART_Initialize function through the "flags" member of the
15270  DRV_USART_INIT structure.
15271 */
15272 
15273 typedef
15274  enum
15275  {
15276  /* Use this if no flags need to be set */
15277  DRV_USART_INIT_FLAG_NONE = /* DOM-IGNORE-BEGIN */
15278  0 /*DOM-IGNORE-END*/
15279  ,
15280  /* Flag to enable "wake on start" operation. If supported and enabled,
15281  this feature will allow the USART to wake-up the device when a
15282  Start bit is received. This option should be selected only when the
15283  device is to placed in Sleep mode. Note that enabling this bit will
15284  also cause the first received character to be lost. Refer to the specific
15285  device data sheet for more information. */
15287  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15288  ,
15289  /* Flag to enable auto baud detection. If supported and enabled, this
15290  feature will allow the USART to automatically detect the baud rate in
15291  use. */
15292  DRV_USART_INIT_FLAG_AUTO_BAUD/*DOM-IGNORE-BEGIN*/
15293  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15294  ,
15295  /* Flag to enable stop in idle. If supported and enabled , this
15296  feature will allow the USART to stop when the CPU enters Idle
15297  mode */
15299  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15301 // *****************************************************************************
15302 /* Operation Mode Initialization Data
15303  Summary:
15304  Defines the initialization data required for different operation modes of
15305  USART.
15306  Description:
15307  This data type defines the initialization data required for different
15308  operation modes of the USART.
15309  Remarks:
15310  None
15311 */
15312 
15313 typedef
15314  union
15315  {
15316  /* Initialization for Addressed mode */
15317  struct
15318  {
15319  /* Address of the device. */
15320  uint8_t address ;
15321  } AddressedModeInit ;
15323 // *****************************************************************************
15324 /* USART Driver Errors.
15325  Summary:
15326  Defines the possible errors that can occur during driver operation.
15327  Description:
15328  This data type defines the possible errors that can occur when occur during
15329  USART driver operation. These values are returned by DRV_USART_ErrorGet
15330  function.
15331  Remarks:
15332  None
15333 */
15334 
15335 typedef
15336  enum
15337  {
15338  /* There was no error */
15340  /*DOM-IGNORE-BEGIN*/
15341  = USART_ERROR_NONE /*DOM-IGNORE-END*/
15342  ,
15343  /* This indicates that a parity error has occurred */
15345  /*DOM-IGNORE-BEGIN*/
15346  = USART_ERROR_PARITY /*DOM-IGNORE-END*/
15347  ,
15348  /* This indicates that a framing error has occurred */
15350  /*DOM-IGNORE-BEGIN*/
15351  = USART_ERROR_FRAMING /*DOM-IGNORE-END*/
15352  ,
15353  /* This indicates a receiver overflow has occurred */
15355  /*DOM-IGNORE-BEGIN*/
15356  = USART_ERROR_RECEIVER_OVERRUN /*DOM-IGNORE-END*/
15357  ,
15358  /* Channel address error (Applicable in DMA mode) */
15359  DRV_USART_ERROR_ADDRESS /*DOM-IGNORE-BEGIN*/
15360  = ( 1 << 4 ) /* DOM-IGNORE-END*/
15361  } DRV_USART_ERROR ;
15362 // *****************************************************************************
15363 /* USART Client-Specific Driver Status
15364  Summary:
15365  Defines the client-specific status of the USART driver.
15366  Description:
15367  This enumeration defines the client-specific status codes of the USART
15368  driver.
15369  Remarks:
15370  Returned by the DRV_USART_ClientStatus function.
15371 */
15372 
15373 typedef
15374  enum
15375  {
15376  /* An error has occurred.*/
15378  /* The driver is closed, no operations for this client are ongoing,
15379  and/or the given handle is invalid. */
15381  /* The driver is currently busy and cannot start additional operations. */
15383  /* The module is running and ready for additional operations */
15386 // *****************************************************************************
15387 /* USART Driver Transfer Flags
15388  Summary
15389  Specifies the status of the receive or transmit
15390  Description
15391  This type specifies the status of the receive or transmit operation.
15392  Remarks:
15393  More than one of these values may be OR'd together to create a complete
15394  status value. To test a value of this type, the bit of interest must be
15395  ANDed with the value and checked to see if the result is non-zero.
15396 */
15397 
15398 typedef
15399  enum
15400  {
15401  /* Indicates that at least one byte of Data has been received */
15403  /*DOM-IGNORE-BEGIN*/
15404  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15405  ,
15406  /* Indicates that the core driver receiver buffer is empty */
15408  /*DOM-IGNORE-BEGIN*/
15409  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15410  ,
15411  /* Indicates that the core driver transmitter buffer is full */
15413  /*DOM-IGNORE-BEGIN*/
15414  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15415  ,
15416  /* Indicates that the core driver transmitter buffer is empty */
15418  /*DOM-IGNORE-BEGIN*/
15419  = ( 1 << 3 ) /*DOM-IGNORE-END*/
15421 // *****************************************************************************
15422 /* USART Driver Initialization Data
15423  Summary:
15424  Defines the data required to initialize or reinitialize the USART driver
15425  Description:
15426  This data type defines the data required to initialize or reinitialize the
15427  USART driver. If the driver is built statically, the members of this data
15428  structure are statically over-ridden by static override definitions in the
15429  system_config.h file.
15430  Remarks:
15431  None.
15432 */
15433 
15434 typedef
15435  struct
15436  {
15437  /* System module initialization data */
15438  SYS_MODULE_INIT moduleInit ;
15439  /* Identifies USART hardware module (PLIB-level) ID. For a static build of
15440  the driver, this is overridden by DRV_USART_MODULE_ID macro in the
15441  system_config.h header file. */
15442  USART_MODULE_ID usartID ;
15443  /* Identifies the Operation mode of the USART driver. For a static build of
15444  the driver, this is overridden by DRV_USART_MODE_SELECT macro in the
15445  system_config.h header file. */
15447  /* Data required by the operation mode of the driver. For a static build of
15448  the driver, this is overridden by DRV_USART_MODE_DATA macro in the
15449  system_config.h header file. */
15451  /* Flags to enable specific features. Refer to the
15452  description of DRV_USART_INIT_FLAGS for more details. For a static build
15453  of the driver, this is overridden by DRV_USART_FLAGS macro in the
15454  system_config.h header file. */
15455  DRV_USART_INIT_FLAGS flags ;
15456  /* USART module Baud Rate Generator Clock. This typically
15457  the peripheral bus clock frequency. For a static build of the driver,
15458  this is overridden by DRV_USART_BRG_CLOCK macro in the system_config.h
15459  header file. */
15460  uint32_t brgClock ;
15461  /* The initial USART line control settings. For a static build of the driver
15462  this is overridden by the DRV_USART_LINE_CONTROL_SET macro in the
15463  system_config.h header file. */
15464  DRV_USART_LINE_CONTROL lineControl ;
15465  /* Baud Rate value to be used, if not using auto baud. For a static build of
15466  the driver, this is overridden by the DRV_USART_BAUD macro in the
15467  system_config.h header file. */
15468  uint32_t baud ;
15469  /* Handshaking mode. For a static build of the driver, this is overridden by
15470  the DRV_USART_HANDSHAKE_SET macro in the system_config.h header file. */
15471  DRV_USART_HANDSHAKE handshake ;
15472  /* Lines enabled for the USART operation. For a static build of the driver,
15473  this is overridden by the DRV_USART_LINES_ENABLE macro in
15474  the system_config.h header file.
15475  For PPS parts, pin selection in ports overrides this. */
15476  USART_OPERATION_MODE linesEnable ;
15477  /* Interrupt source ID for the transmitter interrupt. For a static build of
15478  the driver, this is overridden by the DRV_USART_TRANSMIT_INTERRUPT_SOURCE
15479  macro in the system_config.h header. */
15480  INT_SOURCE interruptTransmit ;
15481  /* Interrupt source ID for the receiver interrupt. For a static build of
15482  the driver, this is overridden by the DRV_USART_RECEIVE_INTERRUPT_SOURCE
15483  macro in the system_config.h header. */
15484  INT_SOURCE interruptReceive ;
15485  /* Interrupt source ID for the error Interrupt. For a static build of the
15486  driver, this is overridden by the DRV_USART_ERROR_INTERRUPT_SOURCE macro
15487  in the system_config.h header. */
15488  INT_SOURCE interruptError ;
15489  /* This is the receive buffer queue size. This is the maximum
15490  number of read requests that driver will queue. For a
15491  static build of the driver, this is overridden by the
15492  DRV_USART_RECEIVE_QUEUE_SIZE macro in system_config.h */
15493  unsigned int queueSizeReceive ;
15494  /* This is the transmit buffer queue size. This is the maximum
15495  number of write requests that driver will queue. For a
15496  static build of the driver, this is overridden by the
15497  DRV_USART_TRANSMIT_QUEUE_SIZE macro in system_config.h */
15498  unsigned int queueSizeTransmit ;
15499  /* This is the USART transmit DMA channel.
15500  For a static build of the driver, this is overridden by the
15501  DRV_USART_XMIT_DMA_CH_IDXn macro in system_config.h */
15502  DMA_CHANNEL dmaChannelTransmit ;
15503  /* This is the USART receive DMA channel.
15504  For a static build of the driver, this is overridden by the
15505  DRV_USART_RCV_DMA_CH_IDXn macro in system_config.h */
15506  DMA_CHANNEL dmaChannelReceive ;
15507  /* This is the USART transmit DMA channel interrupt.
15508  For a static build of the driver, this is overridden by the
15509  DRV_USART_XMIT_DMA_INT_SRC_IDXn macro in system_config.h */
15510  INT_SOURCE dmaInterruptTransmit ;
15511  /* This is the USART receive DMA channel interrupt.
15512  For a static build of the driver, this is overridden by the
15513  DRV_USART_RCV_DMA_INT_SRC_IDXn macro in system_config.h */
15514  INT_SOURCE dmaInterruptReceive ;
15515  } DRV_USART_INIT ;
15516 //DOM-IGNORE-BEGIN
15517 //DOM-IGNORE-END
15518  // #ifndef _DRV_USART_DEFINITIONS_H
15519 /*******************************************************************************
15520  End of File
15521 */
15522 
15523 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h*/
15524 /* CLOSE_FILE Include File */
15525 
15526 // DOM-IGNORE-BEGIN
15527 // DOM-IGNORE-END
15528 // *****************************************************************************
15529 // *****************************************************************************
15530 // Section: USART Driver Module Interface Routines
15531 // *****************************************************************************
15532 // *****************************************************************************
15533 // *****************************************************************************
15534 /* Function:
15535  SYS_MODULE_OBJ DRV_USART_Initialize
15536  (
15537  const SYS_MODULE_INDEX index,
15538  const SYS_MODULE_INIT * const init
15539  )
15540  Summary:
15541  Initializes the USART instance for the specified driver index.
15542  <p><b>Implementation:</b> Static/Dynamic</p>
15543  Description:
15544  This routine initializes the USART driver instance for the specified driver
15545  index, making it ready for clients to open and use it. The initialization
15546  data is specified by the init parameter. The initialization may fail if the
15547  number of driver objects allocated are insufficient or if the specified
15548  driver instance is already initialized. The driver instance index is
15549  independent of the USART module ID. For example, driver instance 0 can be
15550  assigned to USART2. If the driver is built statically, then some of the
15551  initialization parameters are overridden by configuration macros. Refer to
15552  the description of the DRV_USART_INIT data structure for more details on
15553  which members on this data structure are overridden.
15554  Precondition:
15555  None.
15556  Parameters:
15557  index - Identifier for the instance to be initialized
15558  init - Pointer to a data structure containing any data necessary to
15559  initialize the driver.
15560  Returns:
15561  If successful, returns a valid handle to a driver instance object.
15562  Otherwise, returns SYS_MODULE_OBJ_INVALID.
15563  Example:
15564  <code>
15565  // The following code snippet shows an example USART driver initialization.
15566  // The driver is initialized for normal mode and a baud of 300. The
15567  // receive queue size is set to 2 and transmit queue size is set to 3.
15568  DRV_USART_INIT usartInit;
15569  SYS_MODULE_OBJ objectHandle;
15570  usartInit.baud = 300;
15571  usartInit.mode = DRV_USART_OPERATION_MODE_NORMAL;
15572  usartInit.flags = DRV_USART_INIT_FLAG_NONE;
15573  usartInit.usartID = USART_ID_2;
15574  usartInit.brgClock = 80000000;
15575  usartInit.handshake = DRV_USART_HANDSHAKE_NONE;
15576  usartInit.lineControl = DRV_USART_LINE_CONTROL_8NONE1;
15577  usartInit.interruptError = INT_SOURCE_USART_2_ERROR;
15578  usartInit.interruptReceive = INT_SOURCE_USART_2_RECEIVE;
15579  usartInit.queueSizeReceive = 2;
15580  usartInit.queueSizeTransmit = 3;
15581  usartInit.interruptTransmit = INT_SOURCE_USART_2_TRANSMIT;
15582  usartInit.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
15583  objectHandle = DRV_USART_Initialize(DRV_USART_INDEX_1, (SYS_MODULE_INIT*)&usartInitData);
15584  if (SYS_MODULE_OBJ_INVALID == objectHandle)
15585  {
15586  // Handle error
15587  }
15588  </code>
15589  Remarks:
15590  This routine must be called before any other USART routine is called.
15591  This routine should only be called once during system initialization
15592  unless DRV_USART_Deinitialize is called to deinitialize the driver
15593  instance. This routine will NEVER block for hardware access.
15594 */
15595 
15596 SYS_MODULE_OBJ
15598  const SYS_MODULE_INDEX index ,
15599  const SYS_MODULE_INIT * const init ) ;
15600 // *****************************************************************************
15601 /* Function:
15602  void DRV_USART_Deinitialize( SYS_MODULE_OBJ object )
15603  Summary:
15604  Deinitializes the specified instance of the USART driver module.
15605  <p><b>Implementation:</b> Static/Dynamic</p>
15606  Description:
15607  Deinitializes the specified instance of the USART driver module, disabling
15608  its operation (and any hardware). Invalidates all the internal data.
15609  Precondition:
15610  Function DRV_USART_Initialize should have been called before calling this
15611  function.
15612  Parameters:
15613  object - Driver object handle, returned from the
15614  DRV_USART_Initialize routine
15615  Returns:
15616  None.
15617  Example:
15618  <code>
15619  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15620  SYS_STATUS status;
15621  DRV_USART_Deinitialize(object);
15622  status = DRV_USART_Status(object);
15623  if (SYS_MODULE_DEINITIALIZED != status)
15624  {
15625  // Check again later if you need to know
15626  // when the driver is deinitialized.
15627  }
15628  </code>
15629  Remarks:
15630  Once the Initialize operation has been called, the Deinitialize operation
15631  must be called before the Initialize operation can be called again. This
15632  routine will NEVER block waiting for hardware.
15633 */
15634 
15635 void
15637  SYS_MODULE_OBJ object ) ;
15638 // *****************************************************************************
15639 /* Function:
15640  SYS_STATUS DRV_USART_Status( SYS_MODULE_OBJ object )
15641  Summary:
15642  Gets the current status of the USART driver module.
15643  <p><b>Implementation:</b> Static/Dynamic</p>
15644  Description:
15645  This routine provides the current status of the USART driver module.
15646  Precondition:
15647  Function DRV_USART_Initialize should have been called before calling this
15648  function.
15649  Parameters:
15650  object - Driver object handle, returned from the
15651  DRV_USART_Initialize routine
15652  Returns:
15653  SYS_STATUS_READY - Indicates that the driver is busy with a
15654  previous system level operation and cannot start
15655  another
15656  SYS_STATUS_DEINITIALIZED - Indicates that the driver has been
15657  deinitialized
15658  Example:
15659  <code>
15660  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15661  SYS_STATUS usartStatus;
15662  usartStatus = DRV_USART _Status(object);
15663  if (SYS_STATUS_READY == usartStatus)
15664  {
15665  // This means the driver can be opened using the
15666  // DRV_USART_Open() function.
15667  }
15668  </code>
15669  Remarks:
15670  A driver can opened only when its status is SYS_STATUS_READY.
15671 */
15672 
15673 SYS_STATUS
15675  SYS_MODULE_OBJ object ) ;
15676 // *****************************************************************************
15677 /* Function:
15678  void DRV_USART_TasksTransmit (SYS_MODULE_OBJ object );
15679  Summary:
15680  Maintains the driver's transmit state machine and implements its ISR.
15681  <p><b>Implementation:</b> Static/Dynamic</p>
15682  Description:
15683  This routine is used to maintain the driver's internal transmit state
15684  machine and implement its transmit ISR for interrupt-driven implementations.
15685  In polling mode, this function should be called from the SYS_Tasks
15686  function. In interrupt mode, this function should be called in the transmit
15687  interrupt service routine of the USART that is associated with this USART
15688  driver hardware instance.
15689  Precondition:
15690  The DRV_USART_Initialize routine must have been called for the specified
15691  USART driver instance.
15692  Parameters:
15693  object - Object handle for the specified driver instance (returned from
15694  DRV_USART_Initialize)
15695  Returns:
15696  None.
15697  Example:
15698  <code>
15699  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15700  while (true)
15701  {
15702  DRV_USART_TasksTransmit (object);
15703  // Do other tasks
15704  }
15705  </code>
15706  Remarks:
15707  This routine is normally not called directly by an application. It is
15708  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15709  ISR.
15710  This routine may execute in an ISR context and will never block or access any
15711  resources that may cause it to block.
15712 */
15713 
15714 void
15716  SYS_MODULE_OBJ object ) ;
15717 // *****************************************************************************
15718 /* Function:
15719  void DRV_USART_TasksReceive (SYS_MODULE_OBJ object );
15720  Summary:
15721  Maintains the driver's receive state machine and implements its ISR.
15722  <p><b>Implementation:</b> Static/Dynamic</p>
15723  Description:
15724  This routine is used to maintain the driver's internal receive state machine
15725  and implement its receive ISR for interrupt-driven implementations. In
15726  polling mode, this function should be called from the SYS_Tasks function.
15727  In interrupt mode, this function should be called in the receive interrupt
15728  service routine of the USART that is associated with this USART driver
15729  hardware instance.
15730  Precondition:
15731  The DRV_USART_Initialize routine must have been called for the specified
15732  USART driver instance.
15733  Parameters:
15734  object - Object handle for the specified driver instance (returned from
15735  DRV_USART_Initialize)
15736  Returns:
15737  None.
15738  Example:
15739  <code>
15740  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15741  while (true)
15742  {
15743  DRV_USART_TasksReceive (object);
15744  // Do other tasks
15745  }
15746  </code>
15747  Remarks:
15748  This routine is normally not called directly by an application. It is
15749  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15750  ISR.
15751  This routine may execute in an ISR context and will never block or access any
15752  resources that may cause it to block.
15753 */
15754 
15755 void
15757  SYS_MODULE_OBJ object ) ;
15758 // *****************************************************************************
15759 /* Function:
15760  void DRV_USART_TasksError (SYS_MODULE_OBJ object );
15761  Summary:
15762  Maintains the driver's error state machine and implements its ISR.
15763  <p><b>Implementation:</b> Static/Dynamic</p>
15764  Description:
15765  This routine is used to maintain the driver's internal error state machine
15766  and implement its error ISR for interrupt-driven implementations. In
15767  polling mode, this function should be called from the SYS_Tasks function.
15768  In interrupt mode, this function should be called in the error interrupt
15769  service routine of the USART that is associated with this USART driver
15770  hardware instance.
15771  Precondition:
15772  The DRV_USART_Initialize routine must have been called for the specified
15773  USART driver instance.
15774  Parameters:
15775  object - Object handle for the specified driver instance (returned from
15776  DRV_USART_Initialize)
15777  Returns:
15778  None.
15779  Example:
15780  <code>
15781  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15782  while (true)
15783  {
15784  DRV_USART_TasksError (object);
15785  // Do other tasks
15786  }
15787  </code>
15788  Remarks:
15789  This routine is normally not called directly by an application. It is
15790  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15791  ISR.
15792  This routine may execute in an ISR context and will never block or access any
15793  resources that may cause it to block.
15794 */
15795 
15796 void
15798  SYS_MODULE_OBJ object ) ;
15799 // *****************************************************************************
15800 // *****************************************************************************
15801 // Section: USART Driver Client Routines
15802 // *****************************************************************************
15803 // *****************************************************************************
15804 // *****************************************************************************
15805 /* Function:
15806  DRV_HANDLE DRV_USART_Open
15807  (
15808  const SYS_MODULE_INDEX index,
15809  const DRV_IO_INTENT ioIntent
15810  )
15811  Summary:
15812  Opens the specified USART driver instance and returns a handle to it.
15813  <p><b>Implementation:</b> Static/Dynamic</p>
15814  Description:
15815  This routine opens the specified USART driver instance and provides a
15816  handle that must be provided to all other client-level operations to
15817  identify the caller and the instance of the driver. The ioIntent
15818  parameter defines how the client interacts with this driver instance.
15819  The DRV_IO_INTENT_BLOCKING and DRV_IO_INTENT_NONBLOCKING ioIntent options
15820  additionally affect the behavior of the DRV_USART_Read and
15821  DRV_USART_Write functions. If the ioIntent is DRV_IO_INTENT_NONBLOCKING,
15822  then these function will not block even if the required amount of data could
15823  not be processed. If the ioIntent is DRV_IO_INTENT_BLOCKING, these functions
15824  will block until the required amount of data is processed. If the driver is
15825  configured for polling and bare-metal operation, it will not support
15826  DRV_IO_INTENT_BLOCKING. The driver will operation will always be
15827  non-blocking.
15828  If ioIntent is DRV_IO_INTENT_READ, the client will only be able to read from
15829  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be able
15830  to write to the driver. If the ioIntent is DRV_IO_INTENT_READWRITE, the
15831  client will be able to do both, read and write.
15832  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
15833  exclusive access to this client. The driver cannot be opened by any
15834  other client.
15835  Precondition:
15836  Function DRV_USART_Initialize must have been called before calling this
15837  function.
15838  Parameters:
15839  index - Identifier for the object instance to be opened
15840  intent - Zero or more of the values from the enumeration
15841  DRV_IO_INTENT "ORed" together to indicate the intended use
15842  of the driver. See function description for details.
15843  Returns:
15844  If successful, the routine returns a valid open-instance handle (a number
15845  identifying both the caller and the module instance).
15846  If an error occurs, the return value is DRV_HANDLE_INVALID. Error can occur
15847  - if the number of client objects allocated via DRV_USART_CLIENTS_NUMBER is
15848  insufficient.
15849  - if the client is trying to open the driver but driver has been opened
15850  exclusively by another client.
15851  - if the driver hardware instance being opened is not initialized or is
15852  invalid.
15853  - if the client is trying to open the driver exclusively, but has already
15854  been opened in a non exclusive mode by another client.
15855  - if the driver is not ready to be opened, typically when the initialize
15856  routine has not completed execution.
15857  Example:
15858  <code>
15859  DRV_HANDLE handle;
15860  handle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
15861  if (DRV_HANDLE_INVALID == handle)
15862  {
15863  // Unable to open the driver
15864  // May be the driver is not initialized or the initialization
15865  // is not complete.
15866  }
15867  </code>
15868  Remarks:
15869  The handle returned is valid until the DRV_USART_Close routine is called.
15870  This routine will NEVER block waiting for hardware.If the requested intent
15871  flags are not supported, the routine will return DRV_HANDLE_INVALID. This
15872  function is thread safe in a RTOS application.
15873 */
15874 
15875 DRV_HANDLE
15876  DRV_USART_Open (
15877  const SYS_MODULE_INDEX index ,
15878  const DRV_IO_INTENT ioIntent ) ;
15879 // *****************************************************************************
15880 /* Function:
15881  void DRV_USART_Close( DRV_Handle handle )
15882  Summary:
15883  Closes an opened-instance of the USART driver.
15884  <p><b>Implementation:</b> Static/Dynamic</p>
15885  Description:
15886  This routine closes an opened-instance of the USART driver, invalidating the
15887  handle. Any buffers in the driver queue that were submitted by this client
15888  will be removed. After calling this routine, the handle passed in "handle"
15889  must not be used with any of the remaining driver routines (with one
15890  possible exception described in the "Remarks" section). A new handle must
15891  be obtained by calling DRV_USART_Open before the caller may use the driver
15892  again
15893  Precondition:
15894  The DRV_USART_Initialize routine must have been called for the specified
15895  USART driver instance.
15896  DRV_USART_Open must have been called to obtain a valid opened device handle.
15897  Parameters:
15898  handle - A valid open-instance handle, returned from the driver's
15899  open routine
15900  Returns:
15901  None.
15902  Example:
15903  <code>
15904  DRV_HANDLE handle; // Returned from DRV_USART_Open
15905  DRV_USART_Close(handle);
15906  // After this point, the handle cannot be used with any other function
15907  // except the DRV_USART_ClientStatus function, which can be used to query
15908  // the success status of the DRV_USART_Close function.
15909  while(DRV_USART_CLIENT_STATUS_CLOSED != DRV_USART_ClientStatus(handle));
15910  </code>
15911  Remarks:
15912  Usually there is no need for the client to verify that the Close operation
15913  has completed. The driver will abort any ongoing operations when this
15914  routine is called. However, if it requires additional time to do so in a
15915  non-blocking environment, it will still return from the Close operation but
15916  the handle is now a zombie handle. The client can only call the
15917  DRV_USART_ClientStatus on a zombie handle to track the completion of the
15918  Close operation. The DRV_USART_ClientStatus routine will return
15919  DRV_CLIENT_STATUS_CLOSED when the close operation has completed.
15920 */
15921 
15922 void
15923  DRV_USART_Close (
15924  const DRV_HANDLE handle ) ;
15925 // *****************************************************************************
15926 /*
15927  Function:
15928  DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus( DRV_HANDLE handle )
15929  Summary:
15930  Gets the current client-specific status the USART driver.
15931  <p><b>Implementation:</b> Static/Dynamic</p>
15932  Description:
15933  This function gets the client-specific status of the USART driver associated
15934  with the given handle. This function can be used to check the status of
15935  client after the DRV_USART_Close() function has been called.
15936  Preconditions:
15937  The DRV_USART_Initialize function must have been called.
15938  DRV_USART_Open must have been called to obtain a valid opened device
15939  handle.
15940  Parameters:
15941  handle - Handle returned from the driver's open function.
15942  Returns:
15943  A DRV_USART_CLIENT_STATUS value describing the current status of the
15944  driver.
15945  Example:
15946  <code>
15947  DRV_HANDLE handle; // Returned from DRV_USART_Open
15948  DRV_USART_CLIENT_STATUS status;
15949  status = DRV_USART_ClientStatus(handle);
15950  if( DRV_USART_CLIENT_STATUS_CLOSED != status )
15951  {
15952  // The client had not closed.
15953  }
15954  </code>
15955  Remarks:
15956  This function will not block for hardware access and will immediately return
15957  the current status. This function is thread safe when called in a RTOS
15958  application.
15959 */
15960 
15963  DRV_HANDLE handle ) ;
15964 // *****************************************************************************
15965 // *****************************************************************************
15966 // Section: USART Driver Buffer Queuing Model Interface Routines
15967 // *****************************************************************************
15968 // *****************************************************************************
15969 // *****************************************************************************
15970 /* Function:
15971  void DRV_USART_BufferAddWrite
15972  (
15973  const DRV_HANDLE handle,
15974  DRV_USART_BUFFER_HANDLE * bufferHandle,
15975  void * buffer,
15976  size_t size
15977  );
15978  Summary:
15979  Schedule a non-blocking driver write operation.
15980  <p><b>Implementation:</b> Static/Dynamic</p>
15981  Description:
15982  This function schedules a non-blocking write operation. The function returns
15983  with a valid buffer handle in the bufferHandle argument if the write request
15984  was scheduled successfully. The function adds the request to the hardware
15985  instance transmit queue and returns immediately. While the request is in the
15986  queue, the application buffer is owned by the driver and should not be
15987  modified. On returning, the bufferHandle parameter may be
15988  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
15989  - if a buffer could not be allocated to the request
15990  - if the input buffer pointer is NULL
15991  - if the client opened the driver for read-only
15992  - if the buffer size is 0
15993  - if the transmit queue is full or the queue depth is insufficient
15994  If the requesting client registered an event callback with the driver, the
15995  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
15996  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
15997  was not processed successfully.
15998  Precondition:
15999  The DRV_USART_Initialize routine must have been called for the specified
16000  USART device instance and the DRV_USART_Status must have returned
16001  SYS_STATUS_READY.
16002  DRV_USART_Open must have been called to obtain a valid opened device handle.
16003  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16004  the DRV_USART_Open call.
16005  Parameters:
16006  handle - Handle of the communication channel as return by the
16007  DRV_USART_Open function.
16008  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16009  buffer - Data to be transmitted.
16010  size - Buffer size in bytes.
16011  Returns:
16012  The bufferHandle parameter will contain the return buffer handle. This will be
16013  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16014  Example:
16015  <code>
16016  MY_APP_OBJ myAppObj;
16017  uint8_t mybuffer[MY_BUFFER_SIZE];
16018  DRV_USART_BUFFER_HANDLE bufferHandle;
16019  // myUSARTHandle is the handle returned
16020  // by the DRV_USART_Open function.
16021  // Client registers an event handler with driver
16022  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16023  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16024  DRV_USART_BufferAddWrite(myUSARThandle, &bufferHandle,
16025  myBuffer, MY_BUFFER_SIZE);
16026  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16027  {
16028  // Error handling here
16029  }
16030  // Event is received when
16031  // the buffer is processed.
16032  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16033  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16034  {
16035  // contextHandle points to myAppObj.
16036  switch(event)
16037  {
16038  case DRV_USART_BUFFER_EVENT_COMPLETE:
16039  // This means the data was transferred.
16040  break;
16041  case DRV_USART_BUFFER_EVENT_ERROR:
16042  // Error handling here.
16043  break;
16044  default:
16045  break;
16046  }
16047  }
16048  </code>
16049  Remarks:
16050  This function is thread safe in a RTOS application. It can be called from
16051  within the USART Driver Buffer Event Handler that is registered by this
16052  client. It should not be called in the event handler associated with another
16053  USART driver instance. It should not otherwise be called directly in an ISR.
16054 */
16055 
16056 void
16058  const DRV_HANDLE handle ,
16059  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16060  void * buffer ,
16061  const size_t size ) ;
16062 // *****************************************************************************
16063 /* Function:
16064  void DRV_USART_AddressedBufferAddWrite
16065  (
16066  const DRV_HANDLE hClient,
16067  DRV_USART_BUFFER_HANDLE * bufferHandle,
16068  uint8_t address,
16069  void * source,
16070  size_t nWords
16071  );
16072  Summary:
16073  Schedule a non-blocking addressed driver write operation.
16074  <p><b>Implementation:</b> Dynamic</p>
16075  Description:
16076  This function schedules a non-blocking addressed write operation. The function returns
16077  with a valid buffer handle in the bufferHandle argument if the addressed write request
16078  was scheduled successfully. The function adds the request to the hardware
16079  instance transmit queue and returns immediately. While the request is in the
16080  queue, the application buffer is owned by the driver and should not be
16081  modified. On returning, the bufferHandle parameter may be
16082  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
16083  - if a buffer could not be allocated to the request
16084  - if the input buffer pointer is NULL
16085  - if the client opened the driver for read-only
16086  - if the buffer size is 0
16087  - if the transmit queue is full or the queue depth is insufficient
16088  If the requesting client registered an event callback with the driver, the
16089  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16090  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16091  was not processed successfully.
16092  Precondition:
16093  The DRV_USART_Initialize routine must have been called for the specified
16094  USART device instance and the DRV_USART_Status must have returned
16095  SYS_STATUS_READY.
16096  DRV_USART_Open must have been called to obtain a valid opened device handle.
16097  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16098  the DRV_USART_Open call.
16099  The operation mode of the driver must be DRV_USART_OPERATION_MODE_ADDRESSED.
16100  Parameters:
16101  hClient - Handle of the communication channel as return by the
16102  DRV_USART_Open function.
16103  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16104  address - Address of the receiver client
16105  source - Data to be transmitted.
16106  size - Buffer size in 16-bit words.
16107  Returns:
16108  The bufferHandle parameter will contain the return buffer handle. This will be
16109  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16110  Example:
16111  <code>
16112  MY_APP_OBJ myAppObj;
16113  uint16_t mybuffer[MY_BUFFER_SIZE];
16114  DRV_USART_BUFFER_HANDLE bufferHandle;
16115  uint8_t clientAddress;
16116  // myUSARTHandle is the handle returned
16117  // by the DRV_USART_Open function.
16118  // Client registers an event handler with driver
16119  clientAddress = 0x60;
16120  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16121  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16122  DRV_USART_AddressedBufferAddWrite(myUSARThandle, &bufferHandle, clientAddress
16123  myBuffer, MY_BUFFER_SIZE);
16124  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16125  {
16126  // Error handling here
16127  }
16128  // Event is received when
16129  // the buffer is processed.
16130  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16131  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16132  {
16133  // contextHandle points to myAppObj.
16134  switch(event)
16135  {
16136  case DRV_USART_BUFFER_EVENT_COMPLETE:
16137  // This means the data was transferred.
16138  break;
16139  case DRV_USART_BUFFER_EVENT_ERROR:
16140  // Error handling here.
16141  break;
16142  default:
16143  break;
16144  }
16145  }
16146  </code>
16147  Remarks:
16148  This function is thread safe in a RTOS application. It can be called from
16149  within the USART Driver Buffer Event Handler that is registered by this
16150  client. It should not be called in the event handler associated with another
16151  USART driver instance. It should not otherwise be called directly in an ISR.
16152  The source buffer should be a 16-bit word aligned buffer.
16153  The 9th bit of the higher byte 16-bit buffer is used to indicate data/address.
16154 */
16155 
16156 void
16158  const DRV_HANDLE hClient ,
16159  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16160  uint8_t address ,
16161  void * source ,
16162  size_t nWords ) ;
16163 // *****************************************************************************
16164 /* Function:
16165  void DRV_USART_BufferAddRead
16166  (
16167  const DRV_HANDLE handle,
16168  DRV_USART_BUFFER_HANDLE * bufferHandle,
16169  void * buffer,
16170  const size_t size
16171  )
16172  Summary:
16173  Schedule a non-blocking driver read operation.
16174  <p><b>Implementation:</b> Static/Dynamic</p>
16175  Description:
16176  This function schedules a non-blocking read operation. The function returns
16177  with a valid buffer handle in the bufferHandle argument if the read request
16178  was scheduled successfully. The function adds the request to the hardware
16179  instance receive queue and returns immediately. While the request is in the
16180  queue, the application buffer is owned by the driver and should not be
16181  modified. The function returns DRV_USART_BUFFER_HANDLE_INVALID in the
16182  bufferHandle argument:
16183  - if a buffer could not be allocated to the request
16184  - if the input buffer pointer is NULL
16185  - if the buffer size is 0
16186  - if the read queue size is full or queue depth is insufficient.
16187  - if the driver handle is invalid
16188  If the requesting client registered an event callback with the driver, the
16189  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16190  processed successfully of DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16191  was not processed successfully.
16192  Precondition:
16193  The DRV_USART_Initialize routine must have been called for the specified
16194  USART device instance and the DRV_USART_Status must have returned
16195  SYS_STATUS_READY.
16196  DRV_USART_Open must have been called to obtain a valid opened device handle.
16197  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16198  the DRV_USART_Open call.
16199  Parameters:
16200  handle - Handle of the communication channel as returned by the
16201  DRV_USART_Open function.
16202  buffer - Buffer where the received data will be stored.
16203  size - Buffer size in bytes.
16204  Returns:
16205  The buffer handle is returned in the bufferHandle argument. This is
16206  DRV_USART_BUFFER_HANDLE_INVALID if the request was not successful.
16207  Example:
16208  <code>
16209  MY_APP_OBJ myAppObj;
16210  uint8_t mybuffer[MY_BUFFER_SIZE];
16211  DRV_USART_BUFFER_HANDLE bufferHandle;
16212  // myUSARTHandle is the handle returned
16213  // by the DRV_USART_Open function.
16214  // Client registers an event handler with driver
16215  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16216  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16217  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle,
16218  myBuffer, MY_BUFFER_SIZE);
16219  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16220  {
16221  // Error handling here
16222  }
16223  // Event is received when
16224  // the buffer is processed.
16225  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16226  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16227  {
16228  // contextHandle points to myAppObj.
16229  switch(event)
16230  {
16231  case DRV_USART_BUFFER_EVENT_COMPLETE:
16232  // This means the data was transferred.
16233  break;
16234  case DRV_USART_BUFFER_EVENT_ERROR:
16235  // Error handling here.
16236  break;
16237  default:
16238  break;
16239  }
16240  }
16241  </code>
16242  Remarks:
16243  This function is thread safe in a RTOS application. It can be called from
16244  within the USART Driver Buffer Event Handler that is registered by the
16245  client. It should not be called in the event handler associated with another
16246  USART driver instance. It should not be called directly in an ISR.
16247 */
16248 
16249 void
16251  const DRV_HANDLE handle ,
16252  DRV_USART_BUFFER_HANDLE * const bufferHandle ,
16253  void * buffer ,
16254  const size_t size ) ;
16255 // *****************************************************************************
16256 /* Function:
16257  void DRV_USART_BufferEventHandlerSet
16258  (
16259  const DRV_HANDLE handle,
16260  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler,
16261  const uintptr_t context
16262  )
16263  Summary:
16264  Allows a client to identify a buffer event handling function for the driver
16265  to call back when queued buffer transfers have finished.
16266  <p><b>Implementation:</b> Static/Dynamic</p>
16267  Description:
16268  This function allows a client to identify a buffer event handling function
16269  for the driver to call back when queued buffer transfers have finished.
16270  When a client calls either the DRV_USART_BufferAddRead or
16271  DRV_USART_BufferAddWrite function, it is provided with a handle identifying
16272  the buffer that was added to the driver's buffer queue. The driver will
16273  pass this handle back to the client by calling "eventHandler" function when
16274  the buffer transfer has completed.
16275  The event handler should be set before the client performs any "buffer add"
16276  operations that could generate events. The event handler once set, persists
16277  until the client closes the driver or sets another event handler (which
16278  could be a "NULL" pointer to indicate no callback).
16279  Precondition:
16280  The DRV_USART_Initialize routine must have been called for the specified
16281  USART driver instance.
16282  DRV_USART_Open must have been called to obtain a valid opened device handle.
16283  Parameters:
16284  handle - A valid open-instance handle, returned from the driver's
16285  open routine
16286  eventHandler - Pointer to the event handler function.
16287  context - The value of parameter will be passed back to the client
16288  unchanged, when the eventHandler function is called. It can
16289  be used to identify any client specific data object that
16290  identifies the instance of the client module (for example,
16291  it may be a pointer to the client module's state structure).
16292  Returns:
16293  None.
16294  Example:
16295  <code>
16296  // myAppObj is an application specific state data object.
16297  MY_APP_OBJ myAppObj;
16298  uint8_t mybuffer[MY_BUFFER_SIZE];
16299  DRV_USART_BUFFER_HANDLE bufferHandle;
16300  // myUSARTHandle is the handle returned
16301  // by the DRV_USART_Open function.
16302  // Client registers an event handler with driver. This is done once
16303  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16304  (uintptr_t)&myAppObj );
16305  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle
16306  myBuffer, MY_BUFFER_SIZE);
16307  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16308  {
16309  // Error handling here
16310  }
16311  // Event Processing Technique. Event is received when
16312  // the buffer is processed.
16313  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16314  DRV_USART_BUFFER_HANDLE handle, uintptr_t context)
16315  {
16316  // The context handle was set to an application specific
16317  // object. It is now retrievable easily in the event handler.
16318  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) context;
16319  switch(event)
16320  {
16321  case DRV_USART_BUFFER_EVENT_COMPLETE:
16322  // This means the data was transferred.
16323  break;
16324  case DRV_USART_BUFFER_EVENT_ERROR:
16325  // Error handling here.
16326  break;
16327  default:
16328  break;
16329  }
16330  }
16331  </code>
16332  Remarks:
16333  If the client does not want to be notified when the queued buffer transfer
16334  has completed, it does not need to register a callback. This function is
16335  thread safe when called in a RTOS application.
16336 */
16337 
16338 void
16340  const DRV_HANDLE handle ,
16341  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler ,
16342  const uintptr_t context ) ;
16343 // *****************************************************************************
16344 /* Function:
16345  DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove( DRV_USART_BUFFER_HANDLE bufferHandle )
16346  Summary:
16347  Removes a requested buffer from the queue.
16348  <p><b>Implementation:</b> Static/Dynamic</p>
16349  Description:
16350  This function removes a specified buffer from the queue.
16351  The client can use this function to delete
16352  1. An unwated stalled buffer.
16353  2. Queued buffers on timeout.
16354  or in any other use case.
16355  Precondition:
16356  The DRV_USART_Initialize routine must have been called for the specified
16357  USART driver instance.
16358  DRV_USART_Open must have been called to obtain a valid opened device handle.
16359  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16360  must have been called and a valid buffer handle returned.
16361  Parameters:
16362  bufferhandle - Handle of the buffer to delete.
16363  Returns:
16364  DRV_USART_BUFFER_RESULT_HANDLE_INVALID - Buffer handle is invalid.
16365  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED - Buffer handle is expired.
16366  DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY - Buffer is removed from the
16367  queue successfully.
16368  DRV_USART_BUFFER_RESULT_REMOVAL_FAILED - Failed to remove buffer from
16369  the queue because of mutex timeout in RTOS environment.
16370  Example:
16371  <code>
16372  // myAppObj is an application specific object.
16373  MY_APP_OBJ myAppObj;
16374  uint8_t mybuffer[MY_BUFFER_SIZE];
16375  DRV_USART_BUFFER_HANDLE bufferHandle;
16376  // myUSARTHandle is the handle returned
16377  // by the DRV_USART_Open function.
16378  // Client registers an event handler with driver. This is done once
16379  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16380  (uintptr_t)&myAppObj );
16381  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16382  myBuffer, MY_BUFFER_SIZE );
16383  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16384  {
16385  // Error handling here
16386  }
16387  // Event Processing Technique. Event is received when
16388  // the buffer is processed.
16389  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16390  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16391  {
16392  switch(event)
16393  {
16394  case DRV_USART_BUFFER_EVENT_COMPLETE:
16395  // This means the data was transferred.
16396  break;
16397  case DRV_USART_BUFFER_EVENT_ERROR:
16398  // Error handling here.
16399  break;
16400  default:
16401  break;
16402  }
16403  }
16404  // Timeout function, where remove queued buffer if it still exists.
16405  void APP_TimeOut(void)
16406  {
16407  DRV_USART_BUFFER_RESULT bufferResult;
16408  bufferResult = DRV_USART_BufferRemove(bufferHandle);
16409  if(DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY == bufferResult)
16410  {
16411  //Buffer removed succesfully from the queue
16412  }
16413  else
16414  {
16415  //Either buffer is invalid or expired.
16416  //Or not able to acquire mutex in RTOS mode.
16417  }
16418  }
16419  </code>
16420  Remarks:
16421  This function is thread safe when used in a RTOS application.
16422 */
16423 
16426  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16427 // *****************************************************************************
16428 /* Function:
16429  size_t DRV_USART_BufferCompletedBytesGet
16430  (
16431  DRV_USART_BUFFER_HANDLE bufferHandle
16432  );
16433  Summary:
16434  Returns the number of bytes that have been processed for the
16435  specified buffer.
16436  <p><b>Implementation:</b> Static/Dynamic</p>
16437  Description:
16438  This function returns number of bytes that have been processed for the
16439  specified buffer. The client can use this function, in a case where the
16440  buffer has terminated due to an error, to obtain the number of bytes that
16441  have been processed. Or in any other use case.
16442  This function can be used for non-DMA buffer transfers only. It cannot be
16443  used when the USART driver is configured to use DMA.
16444  Precondition:
16445  The DRV_USART_Initialize routine must have been called for the specified
16446  USART driver instance.
16447  DRV_USART_Open must have been called to obtain a valid opened device handle.
16448  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16449  must have been called and a valid buffer handle returned.
16450  Parameters:
16451  bufferhandle - Handle for the buffer of which the processed number of bytes
16452  to be obtained.
16453  Returns:
16454  Returns the number of bytes that have been processed for this buffer.
16455  Returns DRV_USART_BUFFER_HANDLE_INVALID for an invalid or an expired
16456  buffer handle.
16457  Example:
16458  <code>
16459  // myAppObj is an application specific object.
16460  MY_APP_OBJ myAppObj;
16461  uint8_t mybuffer[MY_BUFFER_SIZE];
16462  DRV_USART_BUFFER_HANDLE bufferHandle;
16463  // myUSARTHandle is the handle returned
16464  // by the DRV_USART_Open function.
16465  // Client registers an event handler with driver. This is done once
16466  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16467  (uintptr_t)&myAppObj );
16468  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16469  myBuffer, MY_BUFFER_SIZE );
16470  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16471  {
16472  // Error handling here
16473  }
16474  // Event Processing Technique. Event is received when
16475  // the buffer is processed.
16476  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16477  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16478  {
16479  // The context handle was set to an application specific
16480  // object. It is now retrievable easily in the event handler.
16481  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
16482  size_t processedBytes;
16483  switch(event)
16484  {
16485  case DRV_USART_BUFFER_EVENT_COMPLETE:
16486  // This means the data was transferred.
16487  break;
16488  case DRV_USART_BUFFER_EVENT_ERROR:
16489  // Error handling here.
16490  // We can find out how many bytes were processed in this
16491  // buffer before the error occurred.
16492  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
16493  break;
16494  default:
16495  break;
16496  }
16497  }
16498  </code>
16499  Remarks:
16500  This function is thread safe when used in a RTOS application.
16501 */
16502 
16503 size_t
16505  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16506 // *****************************************************************************
16507 /* Function:
16508  size_t DRV_USART_BufferProcessedSizeGet
16509  (
16510  DRV_USART_BUFFER_HANDLE bufferHandle
16511  );
16512  Summary:
16513  This API will be deprecated and not recommended to use.
16514  Use DRV_USART_BufferCompletedBytesGet to get the number of bytes
16515  processed for the specified buffer.
16516  Description:
16517  None.
16518  Precondition:
16519  None.
16520  Parameters:
16521  None.
16522  Returns:
16523  None.
16524  Example:
16525  None.
16526  Remarks:
16527  None.
16528 */
16529 
16530 size_t
16532  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16533 // *****************************************************************************
16534 // *****************************************************************************
16535 // Section: USART Driver File System Model Routines
16536 // *****************************************************************************
16537 // *****************************************************************************
16538 // *****************************************************************************
16539 /* Function:
16540  size_t DRV_USART_Read
16541  (
16542  const DRV_HANDLE handle,
16543  void * buffer,
16544  const size_t numbytes
16545  )
16546  Summary:
16547  Reads data from the USART.
16548  <p><b>Implementation:</b> Static/Dynamic</p>
16549  Description:
16550  This routine reads data from the USART. This function is blocking if the
16551  driver was opened by the client for blocking operation. This function will
16552  not block if the driver was opened by the client for non blocking operation.
16553  If the ioIntent parameter at the time of opening the driver was
16554  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
16555  until) numbytes of bytes have been received or if an error occurred. If there
16556  are buffers queued for receiving data, these buffers will be serviced first. The
16557  function will not return until the requested number of bytes have been read.
16558  If the ioIntent parameter at the time of opening the driver was
16559  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
16560  bytes that were actually read. The function will not wait until numBytes of
16561  bytes have been read. If there are buffer queued for reading data, then the
16562  function will not block and will return immediately with 0 bytes read.
16563  Precondition:
16564  The DRV_USART_Initialize routine must have been called for the specified
16565  USART driver instance.
16566  DRV_USART_Open must have been called to obtain a valid opened device handle.
16567  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16568  the DRV_USART_Open call.
16569  Parameters:
16570  handle - A valid open-instance handle, returned from the driver's
16571  open routine
16572  buffer - Buffer into which the data read from the USART instance
16573  will be placed.
16574  numbytes - Total number of bytes that need to be read from the module
16575  instance (must be equal to or less than the size of the
16576  buffer)
16577  Returns:
16578  Number of bytes actually copied into the caller's buffer. Returns
16579  DRV_USART_READ_ERROR in case of an error.
16580  Example:
16581  <code>
16582  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16583  char myBuffer[MY_BUFFER_SIZE];
16584  unsigned int count;
16585  unsigned int total;
16586  total = 0;
16587  do
16588  {
16589  count = DRV_USART_Read(myUSARTHandle, &myBuffer[total], MY_BUFFER_SIZE - total);
16590  if(count == DRV_USART_READ_ERROR)
16591  {
16592  // There was an error. The DRV_USART_ErrorGet() function
16593  // can be called to find the exact error.
16594  }
16595  total += count;
16596  // Do something else...
16597  } while( total < MY_BUFFER_SIZE );
16598  </code>
16599  Remarks:
16600  This function is thread safe in a RTOS application. If the driver is
16601  configured for polled operation, this it will not support blocking operation
16602  in a bare metal (non-RTOS) application.
16603 */
16604 
16605 size_t
16606  DRV_USART_Read (
16607  const DRV_HANDLE handle ,
16608  void * buffer ,
16609  const size_t numbytes ) ;
16610 // *****************************************************************************
16611 /* Function:
16612  size_t DRV_USART_Write
16613  (
16614  const DRV_HANDLE handle,
16615  void * buffer,
16616  const size_t numbytes
16617  )
16618  Summary:
16619  Writes data to the USART.
16620  <p><b>Implementation:</b> Static/Dynamic</p>
16621  Description:
16622  This routine writes data to the USART. This function is blocking if the
16623  driver was opened by the client for blocking operation. This function will
16624  not block if the driver was opened by the client for non blocking operation.
16625  If the ioIntent parameter at the time of opening the driver was
16626  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
16627  until) numbytes of bytes have been transmitted or if an error occurred. If
16628  there are buffers queued for writing, the function will wait until all the
16629  preceding buffers are completed. Ongoing buffer transmit operations will not
16630  be affected.
16631  If the ioIntent parameter at the time of opening the driver was
16632  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
16633  bytes that were actually accepted for transmission. The function will not
16634  wait until numBytes of bytes have been transmitted. If there a buffers queued
16635  for transmit, the function will not wait and will return immediately with 0
16636  bytes.
16637  Precondition:
16638  The DRV_USART_Initialize routine must have been called for the specified
16639  USART driver instance.
16640  DRV_USART_Open must have been called to obtain a valid opened device handle.
16641  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16642  the DRV_USART_Open call.
16643  Parameters:
16644  handle - A valid open-instance handle, returned from the driver's
16645  open routine
16646  buffer - Buffer containing the data to written.
16647  numbytes - size of the buffer
16648  Returns:
16649  Number of bytes actually written to the driver. Return DRV_USART_WRITE_ERROR
16650  in case of an error.
16651  Example:
16652  <code>
16653  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16654  char myBuffer[MY_BUFFER_SIZE];
16655  int count;
16656  unsigned int total;
16657  total = 0;
16658  do
16659  {
16660  count = DRV_USART_Write(myUSARTHandle, &myBuffer[total],
16661  MY_BUFFER_SIZE - total);
16662  total += count;
16663  // Do something else...
16664  } while( total < MY_BUFFER_SIZE );
16665  </code>
16666  Remarks:
16667  This function is thread safe in a RTOS application. This function is thread
16668  safe in a RTOS application. If the driver is configured for polled
16669  operation, this it will not support blocking operation in a bare metal (non-RTOS)
16670  application.
16671 */
16672 
16673 size_t
16674  DRV_USART_Write (
16675  const DRV_HANDLE handle ,
16676  void * buffer ,
16677  const size_t numbytes ) ;
16678 // *****************************************************************************
16679 /* Function:
16680  DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus( const DRV_HANDLE handle )
16681  Summary:
16682  Returns the transmitter and receiver transfer status.
16683  <p><b>Implementation:</b> Static/Dynamic</p>
16684  Description:
16685  This returns the transmitter and receiver transfer status.
16686  Precondition:
16687  The DRV_USART_Initialize routine must have been called for the specified
16688  USART driver instance.
16689  DRV_USART_Open must have been called to obtain a valid opened device handle.
16690  Parameters:
16691  handle - A valid open-instance handle, returned from the driver's
16692  open routine
16693  Returns:
16694  A DRV_USART_TRANSFER_STATUS value describing the current status
16695  of the transfer.
16696  Example:
16697  <code>
16698  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16699  if (DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle))
16700  {
16701  // Data has been received that can be read
16702  }
16703  </code>
16704  Remarks:
16705  The returned status may contain a value with more than one of the bits
16706  specified in the DRV_USART_TRANSFER_STATUS enumeration set. The caller
16707  should perform an "AND" with the bit of interest and verify if the result is
16708  non-zero (as shown in the example) to verify the desired status bit. This
16709  function is thread safe when called in a RTOS application.
16710 */
16711 
16714  const DRV_HANDLE handle ) ;
16715 // *****************************************************************************
16716 // *****************************************************************************
16717 // Section: USART Driver Byte Model Routines
16718 // *****************************************************************************
16719 // *****************************************************************************
16720 // *****************************************************************************
16721 /* Function:
16722  uint8_t DRV_USART_ReadByte( const DRV_HANDLE handle )
16723  Summary:
16724  Reads a byte of data from the USART.
16725  <p><b>Implementation:</b> Static/Dynamic</p>
16726  Description:
16727  This routine reads a byte of data from the USART.
16728  Precondition:
16729  The DRV_USART_Initialize routine must have been called for the specified
16730  USART driver instance.
16731  DRV_USART_Open must have been called to obtain a valid opened device handle.
16732  The transfer status should be checked to see if the receiver is not empty
16733  before calling this function.
16734  Parameters:
16735  handle - A valid open-instance handle, returned from the driver's
16736  open routine
16737  Returns:
16738  A data byte received by the driver.
16739  Example:
16740  <code>
16741  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16742  char myBuffer[MY_BUFFER_SIZE];
16743  unsigned int numBytes;
16744  numBytes = 0;
16745  do
16746  {
16747  if( DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle) )
16748  {
16749  myBuffer[numBytes++] = DRV_USART_ReadByte(myUSARTHandle);
16750  }
16751  // Do something else...
16752  } while( numBytes < MY_BUFFER_SIZE);
16753  </code>
16754  Remarks:
16755  This function is thread safe when called in a RTOS application. Note that
16756  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
16757  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
16758  DRV_USART_Write functions in a application. Calling the
16759  DRV_USART_ReadByte and DRV_USART_WriteByte functions will disrupt the
16760  processing of any queued buffers.
16761 */
16762 
16763 uint8_t
16765  const DRV_HANDLE handle ) ;
16766 // *****************************************************************************
16767 /* Function:
16768  void DRV_USART_WriteByte( const DRV_HANDLE handle, const uint8_t byte)
16769  Summary:
16770  Writes a byte of data to the USART.
16771  <p><b>Implementation:</b> Static/Dynamic</p>
16772  Description:
16773  This routine writes a byte of data to the USART.
16774  Precondition:
16775  The DRV_USART_Initialize routine must have been called for the specified
16776  USART driver instance.
16777  DRV_USART_Open must have been called to obtain a valid opened device handle.
16778  The transfer status should be checked to see if transmitter is not full
16779  before calling this function.
16780  Parameters:
16781  handle - A valid open-instance handle, returned from the driver's
16782  open routine
16783  byte - Data byte to write to the USART
16784  Returns:
16785  None.
16786  Example:
16787  <code>
16788  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16789  char myBuffer[MY_BUFFER_SIZE];
16790  unsigned int numBytes;
16791  // Preinitialize myBuffer with MY_BUFFER_SIZE bytes of valid data.
16792  numBytes = 0;
16793  while( numBytes < MY_BUFFER_SIZE );
16794  {
16795  if( !(DRV_USART_TRANSFER_STATUS_TRANSMIT_FULL & DRV_USART_TransferStatus(myUSARTHandle)) )
16796  {
16797  DRV_USART_WriteByte(myUSARTHandle, myBuffer[numBytes++]);
16798  }
16799  // Do something else...
16800  }
16801  </code>
16802  Remarks:
16803  This function is thread safe when called in a RTOS application. Note that
16804  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
16805  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
16806  DRV_USART_Write functions in a application. Calling the
16807  DRV_USART_ReadByte and DRV_USART_WriteByte function will disrupt the
16808  processing of any queued buffers.
16809 */
16810 
16811 void
16813  const DRV_HANDLE handle ,
16814  const uint8_t byte ) ;
16815 // *****************************************************************************
16816 /* Function:
16817  unsigned int DRV_USART_ReceiverBufferSizeGet( const DRV_HANDLE handle )
16818  Summary:
16819  Returns the size of the receive buffer.
16820  <p><b>Implementation:</b> Static/Dynamic</p>
16821  Description:
16822  This routine returns the size of the receive buffer.
16823  Precondition:
16824  The DRV_USART_Initialize routine must have been called for the specified
16825  USART driver instance.
16826  DRV_USART_Open must have been called to obtain a valid opened device handle.
16827  Parameters:
16828  handle - A valid open-instance handle, returned from the driver's
16829  open routine
16830  Returns:
16831  Size of the driver's receive buffer, in bytes.
16832  Example:
16833  <code>
16834  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16835  const uint8_t readBuffer[5];
16836  unsigned int size, numBytes = 0;
16837  unsigned int readbufferLen = sizeof(readBuffer);
16838  size = DRV_USART_ReceiverBufferSizeGet(myUSARTHandle);
16839  // Do something based on the receiver buffer size
16840  </code>
16841  Remarks:
16842  Does not account for client queued buffers. This function is thread safe
16843  when called in a RTOS application.
16844 */
16845 
16846 unsigned int
16848  const DRV_HANDLE handle ) ;
16849 // *****************************************************************************
16850 /* Function:
16851  unsigned int DRV_USART_TransmitBufferSizeGet ( const DRV_HANDLE handle )
16852  Summary:
16853  Returns the size of the transmit buffer.
16854  <p><b>Implementation:</b> Static/Dynamic</p>
16855  Description:
16856  This routine returns the size of the transmit buffer and can be used by the
16857  application to determine the number of bytes to write with the
16858  DRV_USART_WriteByte function.
16859  Precondition:
16860  The DRV_USART_Initialize routine must have been called for the specified
16861  USART driver instance.
16862  DRV_USART_Open must have been called to obtain a valid opened device handle.
16863  Parameters:
16864  handle - A valid open-instance handle, returned from the driver's
16865  open routine
16866  Returns:
16867  Size of the driver's transmit buffer, in bytes.
16868  Examples:
16869  <code>
16870  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16871  const uint8_t writeBuffer[5];
16872  unsigned int size, numBytes = 0;
16873  unsigned int writeBufferLen = sizeof(writeBuffer);
16874  size = DRV_USART_TransmitBufferSizeGet (myUSARTHandle);
16875  // Do something based on the transmitter buffer size
16876  </code>
16877  Remarks:
16878  Does not account for client queued buffers. This function is thread safe
16879  when used in a RTOS application.
16880 */
16881 
16882 unsigned int
16884  const DRV_HANDLE handle ) ;
16885 // *****************************************************************************
16886 /* Function:
16887  bool DRV_USART_ReceiverBufferIsEmpty( const DRV_HANDLE handle )
16888  Summary:
16889  Provides the status of the driver's receive buffer.
16890  <p><b>Implementation:</b> Static/Dynamic</p>
16891  Description:
16892  This routine indicates if the driver's receiver buffer is empty. This
16893  function can be used in conjunction with the DRV_USART_Read and
16894  DRV_USART_ReadByte functions.
16895  Precondition:
16896  The DRV_USART_Initialize routine must have been called for the specified
16897  USART driver instance.
16898  DRV_USART_Open must have been called to obtain a valid opened device handle.
16899  Parameters:
16900  handle - A valid open-instance handle, returned from the driver's
16901  open routine
16902  Returns:
16903  true - if the driver's receive buffer is empty
16904  false - if the driver's receive buffer is not empty
16905  Example:
16906  <code>
16907  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16908  char myBuffer[MY_BUFFER_SIZE];
16909  unsigned int numBytes;
16910  numBytes = 0;
16911  while( numBytes < MY_BUFFER_SIZE );
16912  {
16913  if ( !DRV_USART_ReceiverBufferIsEmpty(myUSARTHandle) )
16914  {
16915  if( numBytes < MY_BUFFER_SIZE )
16916  {
16917  myBuffer[numBytes++] = DRV_USART_ReadByte (myUSARTHandle);
16918  }
16919  else
16920  {
16921  break;
16922  }
16923  }
16924  // Do something else while more data is received.
16925  }
16926  </code>
16927  Remarks:
16928  Does not account for client queued buffers. This function is safe thread
16929  safe when used in a RTOS application.
16930 */
16931 
16932 bool
16934  const DRV_HANDLE handle ) ;
16935 // *****************************************************************************
16936 /* Function:
16937  bool DRV_USART_TransmitBufferIsFull( const DRV_HANDLE handle )
16938  Summary:
16939  Provides the status of the driver's transmit buffer.
16940  <p><b>Implementation:</b> Static/Dynamic</p>
16941  Description:
16942  This routine identifies if the driver's transmit buffer is full or not. This
16943  function can be used in conjunction with the DRV_USART_Write and
16944  DRV_USART_WriteByte functions.
16945  Precondition:
16946  The DRV_USART_Initialize routine must have been called for the specified
16947  USART driver instance.
16948  DRV_USART_Open must have been called to obtain a valid opened device handle.
16949  Parameters:
16950  handle - A valid open-instance handle, returned from the driver's
16951  open routine
16952  Returns:
16953  true - if the transmit buffer is full
16954  false - if the transmit buffer is not full
16955  Example:
16956  <code>
16957  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16958  unsigned int numBytes;
16959  int bytesToWrite;
16960  const uint8_t writeBuffer[35] = "1234567890ABCDEFGHIJKLMNOP\n" ;
16961  int writebufferLen = strlen((char *)writeBuffer);
16962  numBytes = 0;
16963  while( numBytes < writebufferLen )
16964  {
16965  if (DRV_USART_TransmitBufferisFull())
16966  {
16967  // Do something else until there is some room in the driver's Transmit buffer.
16968  }
16969  else
16970  {
16971  DRV_USART_WriteByte(myUSARTHandle, writeBuffer[numBytes++]);
16972  }
16973  }
16974  </code>
16975  Remarks:
16976  Does not account for client queued buffers. This function is thread safe
16977  when called in a RTOS application.
16978 */
16979 
16980 bool
16982  const DRV_HANDLE handle ) ;
16983 // *****************************************************************************
16984 /* Function:
16985  void DRV_USART_ByteTransmitCallbackSet
16986  (
16987  const SYS_MODULE_INDEX index,
16988  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
16989  )
16990  Summary:
16991  Registers a callback function for byte transmit event.
16992  Description:
16993  This function allows a transmit callback function to be registered with the
16994  driver. The callback function is invoked when a byte has been transmitted
16995  using DRV_USART_WriteByte () function.
16996  The callback function should be registered with the driver prior to any
16997  writes to the driver. The callback functionality is available only in the
16998  interrupt mode of operation. The driver clears the interrupt after invoking
16999  the callback function.
17000  Precondition:
17001  The DRV_USART_Initialize routine must have been called for the specified
17002  USART driver instance.
17003  Parameters:
17004  index - Identifier for the object instance to be opened
17005  eventHandler - Pointer to the event handler function.
17006  Returns:
17007  None.
17008  Example:
17009  <code>
17010  // myAppObj is an application specific state data object.
17011  MY_APP_OBJ myAppObj;
17012  uint8_t mybuffer[MY_BUFFER_SIZE];
17013  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17014  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17015  (uintptr_t)&myAppObj );
17016  // Register an event handler with driver. This is done once
17017  DRV_USART_ByteTransmitCallbackSet (DRV_USART_INDEX_0, APP_USARTTransmitEventHandler);
17018  DRV_USART_WriteByte (myUSARThandle, myBuffer[0]);
17019  // Event Processing Technique. Event is received when
17020  // the byte is transmitted.
17021  void APP_USARTTransmitEventHandler (const SYS_MODULE_INDEX index)
17022  {
17023  // Byte has been transmitted. Handle the event.
17024  }
17025  </code>
17026  Remarks:
17027  None
17028 */
17029 
17030 void
17032  const SYS_MODULE_INDEX index ,
17033  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17034 // *****************************************************************************
17035 /* Function:
17036  void DRV_USART_ByteReceiveCallbackSet
17037  (
17038  const SYS_MODULE_INDEX index,
17039  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17040  )
17041  Summary:
17042  Registers receive callback function for byte receive event.
17043  Description:
17044  This function allows a receive callback function to be registered with the
17045  driver. The callback function is invoked when a byte has been received. The
17046  received byte can then be read using DRV_USART_ReadByte() function.
17047  The callback function should be registered with the driver as part of the
17048  initialization. The callback functionality is available only in the
17049  interrupt mode of operation. The driver clears the interrupt after invoking
17050  the callback function.
17051  Precondition:
17052  The DRV_USART_Initialize routine must have been called for the specified
17053  USART driver instance.
17054  Parameters:
17055  index - Identifier for the object instance to be opened
17056  eventHandler - Pointer to the event handler function.
17057  Returns:
17058  None.
17059  Example:
17060  <code>
17061  // myAppObj is an application specific state data object.
17062  MY_APP_OBJ myAppObj;
17063  uint8_t mybuffer[MY_BUFFER_SIZE];
17064  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17065  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17066  (uintptr_t)&myAppObj );
17067  // Register an event handler with driver. This is done once
17068  DRV_USART_ByteReceiveCallbackSet(DRV_USART_INDEX_0, APP_USARTReceiveEventHandler);
17069  // Event Processing Technique. Event is received when
17070  // a byte is received.
17071  void APP_USARTReceiveEventHandler(const SYS_MODULE_INDEX index)
17072  {
17073  // Byte has been Received. Handle the event.
17074  // Read byte using DRV_USART_ReadByte ()
17075  // DRV_USART_ReceiverBufferIsEmpty() function can be used to
17076  // check if the receiver buffer is empty.
17077  }
17078  </code>
17079  Remarks:
17080  None
17081 */
17082 
17083 void
17085  const SYS_MODULE_INDEX index ,
17086  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17087 // *****************************************************************************
17088 /* Function:
17089  void DRV_USART_ByteErrorCallbackSet
17090  (
17091  const SYS_MODULE_INDEX index,
17092  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17093  )
17094  Summary:
17095  Registers callback to handle for byte error events.
17096  Description:
17097  This function allows a callback function to be registered with the driver
17098  to handle the error events occurring in the transmit/receive path during
17099  byte transfers.
17100  The callback function should be registered as part of the initialization.
17101  The callback functionality is available only in the interrupt mode of
17102  operation. The driver clears the interrupt after invoking the callback
17103  function.
17104  Precondition:
17105  The DRV_USART_Initialize routine must have been called for the specified
17106  USART driver instance.
17107  Parameters:
17108  index - Identifier for the object instance to be opened
17109  eventHandler - Pointer to the event handler function.
17110  Returns:
17111  None.
17112  Example:
17113  <code>
17114  // myAppObj is an application specific state data object.
17115  MY_APP_OBJ myAppObj;
17116  uint8_t mybuffer[MY_BUFFER_SIZE];
17117  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17118  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17119  (uintptr_t)&myAppObj );
17120  // Register an event handler with driver. This is done once
17121  DRV_USART_ByteErrorCallbackSet (DRV_USART_INDEX_0, APP_USARTErrorEventHandler);
17122  // Event Processing Technique.
17123  void APP_USARTErrorEventHandler(const SYS_MODULE_INDEX index)
17124  {
17125  // Error has occurred. Handle the event.
17126  }
17127  </code>
17128  Remarks:
17129  None
17130 */
17131 
17132 void
17134  const SYS_MODULE_INDEX index ,
17135  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17136 // *****************************************************************************
17137 // *****************************************************************************
17138 // Section: USART Driver Setup and Status Routines
17139 // *****************************************************************************
17140 // *****************************************************************************
17141 // *****************************************************************************
17142 /* Function:
17143  DRV_USART_ERROR DRV_USART_ErrorGet(DRV_HANDLE client);
17144  Summary:
17145  This function returns the error(if any) associated with the last client
17146  request.
17147  <p><b>Implementation:</b> Static/Dynamic</p>
17148  Description:
17149  This function returns the error(if any) associated with the last client
17150  request. DRV_USART_Read and DRV_USART_Write will update the client
17151  error status when these functions return DRV_USART_TRANSFER_ERROR. If the
17152  driver send a DRV_USART_BUFFER_EVENT_ERROR to the client, the client can
17153  call this function to know the error cause. The error status will be updated
17154  on every operation and should be read frequently (ideally immediately after
17155  the driver operation has completed) to know the relevant error status.
17156  Precondition:
17157  The DRV_USART_Initialize routine must have been called for the specified
17158  USART driver instance.
17159  DRV_USART_Open must have been called to obtain a valid opened device handle.
17160  Parameters:
17161  bufferhandle - Handle of the buffer of which the processed number of bytes
17162  to be obtained.
17163  Returns:
17164  A DRV_USART_ERROR type indicating last known error status.
17165  Example:
17166  <code>
17167  // myAppObj is an application specific object.
17168  MY_APP_OBJ myAppObj;
17169  uint8_t mybuffer[MY_BUFFER_SIZE];
17170  DRV_USART_BUFFER_HANDLE bufferHandle;
17171  // myUSARTHandle is the handle returned
17172  // by the DRV_USART_Open function.
17173  // Client registers an event handler with driver. This is done once.
17174  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
17175  (uintptr_t)&myAppObj );
17176  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
17177  myBuffer, MY_BUFFER_SIZE );
17178  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
17179  {
17180  // Error handling here
17181  }
17182  // Event Processing Technique. Event is received when
17183  // the buffer is processed.
17184  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
17185  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
17186  {
17187  // The context handle was set to an application specific
17188  // object. It is now retrievable easily in the event handler.
17189  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
17190  size_t processedBytes;
17191  switch(event)
17192  {
17193  case DRV_USART_BUFFER_EVENT_COMPLETE:
17194  // This means the data was transferred.
17195  break;
17196  case DRV_USART_BUFFER_EVENT_ERROR:
17197  // Error handling here.
17198  // We can find out how many bytes were processed in this
17199  // buffer before the error occurred. We can also find
17200  // the error cause.
17201  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
17202  if(DRV_USART_ERROR_RECEIVE_OVERRUN == DRV_USART_ErrorGet(myUSARTHandle))
17203  {
17204  // There was an receive over flow error.
17205  // Do error handling here.
17206  }
17207  break;
17208  default:
17209  break;
17210  }
17211  }
17212  </code>
17213  Remarks:
17214  It is the client's responsibility to make sure that the error status is
17215  obtained frequently. The driver will update the client error status
17216  regardless of whether this has been examined by the client. This function
17217  is thread safe when used in a RTOS application.
17218 */
17219 
17222  const DRV_HANDLE client ) ;
17223 // *****************************************************************************
17224 /* Function:
17225  void DRV_USART_BaudSet(DRV_HANDLE client, uint32_t baud);
17226  Summary:
17227  This function changes the USART module baud to the specified value.
17228  <p><b>Implementation:</b> Static/Dynamic</p>
17229  Description:
17230  This function changes the USART module baud to the specified value. Any
17231  queued buffer requests will be processed at the updated baud. The USART
17232  driver operates at the baud specified in DRV_USART_Initialize function
17233  unless the DRV_USART_BaudSet function is called to change the baud.
17234  Precondition:
17235  The DRV_USART_Initialize routine must have been called for the specified
17236  USART driver instance.
17237  DRV_USART_Open must have been called to obtain a valid opened device handle.
17238  Parameters:
17239  handle - client handle returned by DRV_USART_Open function.
17240  baud - desired baud.
17241  Returns:
17242  None.
17243  Example:
17244  <code>
17245  // myUSARTHandle is the handle returned
17246  // by the DRV_USART_Open function.
17247  DRV_USART_BaudSet(myUSARTHandle, 9600);
17248  </code>
17249  Remarks:
17250  The implementation of this function, in this release of the driver, changes
17251  the baud immediately. This may interrupt on-going data transfer. It is
17252  recommended that the driver be opened exclusively if this function is to be
17253  called. This function is thread safe when used in a RTOS application.
17254 */
17255 
17258  const DRV_HANDLE client ,
17259  uint32_t baud ) ;
17260 // *****************************************************************************
17261 /* Function:
17262  void DRV_USART_LineControlSet
17263  (
17264  DRV_HANDLE client,
17265  DRV_USART_LINE_CONTROL lineControl
17266  );
17267  Summary:
17268  This function changes the USART module line control to the specified value.
17269  <p><b>Implementation:</b> Static/Dynamic</p>
17270  Description:
17271  This function changes the USART module line control parameters to the
17272  specified value. Any queued buffer requests will be processed at the
17273  updated line control parameters. The USART driver operates at the line
17274  control parameters specified in DRV_USART_Initialize function unless the
17275  DRV_USART_LineControlSet function is called to change the line control
17276  parameters.
17277  Precondition:
17278  The DRV_USART_Initialize routine must have been called for the specified
17279  USART driver instance.
17280  DRV_USART_Open must have been called to obtain a valid opened device handle.
17281  Parameters:
17282  handle - client handle returned by DRV_USART_Open function.
17283  lineControl - line control parameters.
17284  Returns:
17285  DRV_USART_LINE_CONTROL_SET_SUCCESS if the function was successful. Returns
17286  DRV_HANDLE_INVALID if the client handle is not valid.
17287  Example:
17288  <code>
17289  // myUSARTHandle is the handle returned
17290  // by the DRV_USART_Open function.
17291  DRV_USART_LineControlSet(myUSARTHandle, DRV_USART_LINE_CONTROL_8NONE1);
17292  </code>
17293  Remarks:
17294  The implementation of this function, in this release of the driver, changes
17295  the line control immediately. This may interrupt on-going data transfer. It
17296  is recommended that the driver be opened exclusively if this function is to
17297  be called. This function is thread safe when called in a RTOS application.
17298 */
17299 
17302  const DRV_HANDLE client ,
17303  const DRV_USART_LINE_CONTROL lineControl ) ;
17304 //DOM-IGNORE-BEGIN
17305 //DOM-IGNORE-END
17306  // #ifndef _DRV_USART_H
17307 /*******************************************************************************
17308  End of File
17309 */
17310 
17311 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h*/
17312 /* CLOSE_FILE Include File */
17313 
17314 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h */
17315 /*******************************************************************************
17316  USART Driver Variant Mapping
17317  Company:
17318  Microchip Technology Inc.
17319  File Name:
17320  drv_usart_variant_mapping.h
17321  Summary:
17322  USART Driver Variant Mapping
17323  Description:
17324  This file provides feature and build variant mapping macros allowing the
17325  driver to easily be built with different implementation variations based
17326  on static build-time configuration selections.
17327 *******************************************************************************/
17328 //DOM-IGNORE-BEGIN
17329 /*******************************************************************************
17330 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
17331 Microchip licenses to you the right to use, modify, copy and distribute
17332 Software only when embedded on a Microchip microcontroller or digital signal
17333 controller that is integrated into your product or third party product
17334 (pursuant to the sublicense terms in the accompanying license agreement).
17335 You should refer to the license agreement accompanying this Software for
17336 additional information regarding your rights and obligations.
17337 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17338 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17339 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17340 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17341 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17342 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17343 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17344 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17345 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17346 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17347 *******************************************************************************/
17348 //DOM-IGNORE-END
17349 #ifndef _DRV_USART_FEATURE_MAPPING_H
17350 #define _DRV_USART_FEATURE_MAPPING_H
17351 // *****************************************************************************
17352 // *****************************************************************************
17353 // Section: Interrrupt Variations
17354 // *****************************************************************************
17355 // *****************************************************************************
17356 /* Mapping of the interrupt mode variations
17357 */
17358  /* Driver is configured for polled mode */
17359 #define _DRV_USART_InterruptSourceIsEnabled( source ) false
17360 #define _DRV_USART_InterruptSourceEnable( source )
17361 #define _DRV_USART_InterruptSourceDisable( source ) false
17362 #define _DRV_USART_InterruptSourceStatusClear( source ) SYS_INT_SourceStatusClear ( source )
17363 #define _DRV_USART_SEM_POST( x ) OSAL_SEM_Post ( x )
17364 #define _DRV_USART_TAKE_MUTEX( x , y ) OSAL_MUTEX_Lock ( x , y )
17365 #define _DRV_USART_RELEASE_MUTEX( x ) OSAL_MUTEX_Unlock ( x )
17366 #define _SYS_DMA_ChannelForceStart( channelHandle ) SYS_DMA_ChannelForceStart ( channelHandle )
17367  /* This means the driver is being built in a baremetal application.
17368  We cannot let a client open the driver in blocking mode */
17369 #define _DRV_USART_ALWAYS_NON_BLOCKING ( DRV_IO_INTENT_NONBLOCKING )
17370 // *****************************************************************************
17371 // *****************************************************************************
17372 // Section: Buffer Queue support
17373 // *****************************************************************************
17374 // *****************************************************************************
17375 /* Mapping of macros for buffer queue support
17376 */
17377  /* We dont need buffer queues or byte model support */
17378 #define _DRV_USART_TRANSMIT_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteTransmitTasks ( x )
17379 #define _DRV_USART_RECEIVE_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteReceiveTasks ( x )
17380 #define _DRV_USART_ERROR_TASKS( x ) _DRV_USART_ByteErrorTasks ( x )
17381 #define _DRV_USART_CLIENT_BUFFER_QUEUE_OBJECTS_REMOVE( x ) true
17382 #define _DRV_USART_ByteModelInterruptSourceEnable( source )
17383 // *****************************************************************************
17384 // *****************************************************************************
17385 // Initializtion Parameter Static Overrides
17386 // *****************************************************************************
17387 // *****************************************************************************
17388  //_DRV_USART_FEATURE_MAPPING_H
17389 /*******************************************************************************
17390  End of File
17391 */
17392 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h*/
17393 /* CLOSE_FILE Include File */
17394 
17395 #include "system/clk/sys_clk.h"
17396 #include "system/int/sys_int.h"
17397 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h */
17398 /*******************************************************************************
17399  Debug System Services Library Header
17400  Company:
17401  Microchip Technology Inc.
17402 
17403  File Name:
17404  sys_debug.h
17405  Summary:
17406  Defines the common debug definitions and interfaces used by MPLAB Harmony
17407  libraries to report errors and debug information to the user.
17408  Description:
17409  This header file defines the common debug definitions and interface macros
17410  (summary below) and prototypes used by MPLAB Harmony libraries to report
17411  errors and debug information to the user.
17412  *******************************************************************************/
17413 //DOM-IGNORE-BEGIN
17414 /*******************************************************************************
17415 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
17416 Microchip licenses to you the right to use, modify, copy and distribute
17417 Software only when embedded on a Microchip microcontroller or digital signal
17418 controller that is integrated into your product or third party product
17419 (pursuant to the sublicense terms in the accompanying license agreement).
17420 You should refer to the license agreement accompanying this Software for
17421 additional information regarding your rights and obligations.
17422 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17423 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17424 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17425 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17426 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17427 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17428 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17429 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17430 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17431 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17432  *******************************************************************************/
17433 //DOM-IGNORE-END
17434 #ifndef _SYS_DEBUG_H
17435 #define _SYS_DEBUG_H
17436 #include "C:\microchip\harmony\v2_06\framework\system\system.h"
17437  /* LDRA full path */
17438 // This should be defined in system_config.h. It is added here as a build safe-guard.
17439 #define SYS_DEBUG_BUFFER_DMA_READY
17440 // *****************************************************************************
17441 // *****************************************************************************
17442 // Section: SYS DEBUG Data Types
17443 // *****************************************************************************
17444 // *****************************************************************************
17445 // *****************************************************************************
17446 /* SYS_ERROR_LEVEL enumeration
17447  Summary:
17448  System error message priority levels.
17449  Description:
17450  This enumeration defines the supported system error message priority values.
17451  Remarks:
17452  Used by debug message macros to compare individual message priority against
17453  a global system-wide error message priority level to determine if an
17454  individual message should be displayed.
17455 */
17456 
17457 typedef
17458  enum
17459  {
17460  /* Errors that have the potential to cause a system crash. */
17462  /* Errors that have the potential to cause incorrect behavior. */
17464  /* Warnings about potentially unexpected behavior or side effects. */
17466  /* Information helpful to understanding potential errors and warnings. */
17468  /* Verbose information helpful during debugging and testing. */
17470  } SYS_ERROR_LEVEL ;
17471 // DOM-IGNORE-BEGIN
17472 // *****************************************************************************
17473 /* Do not use this variable directly. Use SYS_DEBUG_ErrorLevelGet or
17474  SYS_DEBUG_ErrorLevelSet functions to access this value.
17475 */
17476 
17477 extern SYS_ERROR_LEVEL
17478  gblErrLvl ;
17479 // DOM-IGNORE-END
17480 // *****************************************************************************
17481 /* SYS Debug Module Index Number
17482  Summary:
17483  Debug System Service index.
17484  Description:
17485  This constant defines a symbolic name for the debug system service index.
17486  Remarks:
17487  There can only be a single debug system service instance in the system.
17488 */
17489 #define SYS_DEBUG_INDEX_0 0
17490 // *****************************************************************************
17491 /* SYS Debug Initialize structure
17492  Summary:
17493  Defines the data required to initialize the debug system service.
17494  Description:
17495  This structure defines the data required to initialize the debug system
17496  service.
17497  Remarks:
17498  None.
17499 */
17500 
17501 typedef
17502  struct
17503  {
17504  /* System module initialization */
17505  SYS_MODULE_INIT moduleInit ;
17506  /* Initial system error level setting. */
17507  SYS_ERROR_LEVEL errorLevel ;
17508  /* Console index to receive debug messages */
17509  SYS_MODULE_INDEX consoleIndex ;
17510  } SYS_DEBUG_INIT ;
17511 // *****************************************************************************
17512 // *****************************************************************************
17513 // Section: SYS DEBUG Functions
17514 // *****************************************************************************
17515 // *****************************************************************************
17516 // *****************************************************************************
17517 /* Function:
17518  SYS_MODULE_OBJ SYS_DEBUG_Initialize( const SYS_MODULE_INDEX index,
17519  const SYS_MODULE_INIT * const init )
17520  Summary:
17521  Initializes the global error level and specific module instance.
17522  Description:
17523  This function initializes the global error level. It also initializes any
17524  internal system debug module data structures.
17525  Precondition:
17526  None.
17527  Parameters:
17528  index - Index for the instance to be initialized
17529  init - Pointer to a data structure containing any data necessary
17530  to initialize the debug service. This pointer may be null
17531  if no data is required because static overrides have
17532  been provided.
17533  Returns:
17534  If successful, returns a valid handle to an object. Otherwise, it
17535  returns SYS_MODULE_OBJ_INVALID.
17536  Example:
17537  <code>
17538  SYS_MODULE_OBJ objectHandle;
17539  SYS_DEBUG_INIT debugInit =
17540  {
17541  .moduleInit = {0},
17542  .errorLevel = SYS_ERROR_DEBUG,
17543  };
17544  objectHandle = SYS_Debug_Initialize (SYS_DEBUG_CONSOLE, (SYS_MODULE_INIT*)&debugInit);
17545  if (SYS_MODULE_OBJ_INVALID == objectHandle)
17546  {
17547  // Handle error
17548  }
17549  </code>
17550  Remarks:
17551  This routine should only be called once during system initialization. If the
17552  system was already initialized it safely returns without causing any disturbance.
17553 */
17554 
17555 SYS_MODULE_OBJ
17557  const SYS_MODULE_INDEX index ,
17558  const SYS_MODULE_INIT * const init ) ;
17559 // *****************************************************************************
17560 /* Function:
17561  void SYS_DEBUG_Reinitialize( SYS_MODULE_OBJ object,
17562  const SYS_MODULE_INIT * const init )
17563  Summary:
17564  Reinitializes and refreshes the data structure for the instance of the
17565  Debug module.
17566  Description:
17567  This function reinitializes and refreshes the data structure for the instance
17568  of the Debug module using the supplied data.
17569  Precondition:
17570  The SYS_DEBUG_Initialize function should have been called before calling
17571  this function.
17572  Parameters:
17573  object - Identifies the SYS DEBUG Object returned by the Initialize
17574  interface
17575  init - Pointer to the data structure containing any data
17576  necessary to initialize the hardware
17577  Returns:
17578  None
17579  Example:
17580  <code>
17581  SYS_MODULE_OBJ objectHandle;
17582  // Populate the console initialization structure
17583  SYS_DEBUG_INIT dbgInit =
17584  {
17585  .moduleInit = {0},
17586  .errorLevel = SYS_ERROR_DEBUG,
17587  };
17588  SYS_DEBUG_Reinitialize (objectHandle, (SYS_MODULE_INIT*)&dbgInit);
17589  </code>
17590  Remarks:
17591  This operation uses the same initialization data structure as the
17592  SYS_DEBUG_Initialize operation. This function can be called multiple times
17593  to reinitialize the module.
17594 */
17595 
17596 void
17598  SYS_MODULE_OBJ object ,
17599  const SYS_MODULE_INIT * const init ) ;
17600 // *****************************************************************************
17601 /* Function:
17602  void SYS_DEBUG_Deinitialize( SYS_MODULE_OBJ object )
17603  Summary:
17604  Deinitializes the specific module instance of the Debug module.
17605  Description:
17606  This function deinitializes the specific module instance disabling its
17607  operation (and any hardware for driver modules). Resets all of the internal
17608  data structures and fields for the specified instance to the default settings.
17609  Precondition:
17610  The SYS_DEBUG_Initialize function should have been called before calling
17611  this function.
17612  Parameters:
17613  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
17614  Returns:
17615  None.
17616  Example:
17617  <code>
17618  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
17619  SYS_DEBUG_Deinitialize (object);
17620  </code>
17621  Remarks:
17622  Once the Initialize operation has been called, the Deinitialize
17623  operation must be called before the Initialize operation can be called
17624  again.
17625 */
17626 
17627 void
17629  SYS_MODULE_OBJ object ) ;
17630 // *****************************************************************************
17631 /* Function:
17632  void SYS_DEBUG_Tasks( SYS_MODULE_OBJ object )
17633  Summary:
17634  Maintains the debug module's state machine.
17635  Description:
17636  This function is used to maintain the debug module's internal state
17637  machine and implement its ISR for interrupt-driven implementations.
17638  Precondition:
17639  The SYS_DEBUG_Initialize function must have been called for the specified
17640  CONSOLE driver instance.
17641  Parameters:
17642  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
17643  Returns:
17644  None.
17645  Example:
17646  <code>
17647  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
17648  while (true)
17649  {
17650  SYS_DEBUG_Tasks (object);
17651  // Do other tasks
17652  }
17653  </code>
17654  Remarks:
17655  This function is normally not called directly by an application. It is
17656  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
17657  ISR.
17658 */
17659 
17660 void
17661  SYS_DEBUG_Tasks (
17662  SYS_MODULE_OBJ object ) ;
17663 // *****************************************************************************
17664 /* Function:
17665  SYS_STATUS SYS_DEBUG_Status( SYS_MODULE_OBJ object )
17666  Summary:
17667  Returns status of the specific instance of the debug service module.
17668  Description:
17669  This function returns the status of the specific debug service module
17670  instance.
17671  Precondition:
17672  The SYS_CONSOLE_Initialize function should have been called before calling
17673  this function.
17674  Parameters:
17675  object - Debug module object handle, returned from SYS_DEBUG_Initialize
17676  Returns:
17677  * SYS_STATUS_READY - Indicates that the module is running and
17678  ready to service requests. Any value greater
17679  than SYS_STATUS_READY is also a normal
17680  running state in which the module is ready
17681  to accept new operations.
17682  * SYS_STATUS_BUSY - Indicates that the module is busy with a
17683  previous system level operation and cannot
17684  start another.
17685  * SYS_STATUS_ERROR - Indicates that the module is in an error
17686  state. Any value less than SYS_STATUS_ERROR
17687  is also an error state.
17688  * SYS_STATUS_UNINITIALIZED - Indicates that the module has not been
17689  initialized or has been deinitialized.
17690  Example:
17691  <code>
17692  SYS_MODULE_OBJ object; // Returned from SYS_CONSOLE_Initialize
17693  SYS_STATUS debugStatus;
17694  debugStatus = SYS_DEBUG_Status (object);
17695  if (SYS_STATUS_ERROR >= debugStatus)
17696  {
17697  // Handle error
17698  }
17699  </code>
17700  Remarks:
17701  None.
17702 */
17703 
17704 SYS_STATUS
17706  SYS_MODULE_OBJ object ) ;
17707 // *****************************************************************************
17708 // *****************************************************************************
17709 // Section: SYS DEBUG Console Functions
17710 // *****************************************************************************
17711 // *****************************************************************************
17712 // *****************************************************************************
17713 /* Function:
17714  SYS_DEBUG_Message( const char* message );
17715  Summary:
17716  Prints a message to the console regardless of the system error level.
17717  Description:
17718  This function prints a message to the console regardless of the system
17719  error level. It can be used as an implementation of the SYS_MESSAGE and
17720  SYS_DEBUG_MESSAGE macros.
17721  Precondition:
17722  SYS_DEBUG_Initialize must have returned a valid object handle and the
17723  SYS_DEBUG_Tasks function must be called by the system to complete the
17724  message request.
17725  Parameters:
17726  message - Pointer to a message string to be displayed.
17727  Returns:
17728  None.
17729  Example:
17730  <code>
17731  // In system_config.h:
17732 #define SYS_MESSAGE(message) SYS_DEBUG_Message(message)
17733 
17734  // In source (.c) files:
17735  SYS_MESSAGE("My Message\n\r");
17736  </code>
17737  Remarks:
17738  Do not call this function directly. Call the SYS_MESSAGE or
17739  SYS_DEBUG_MESSAGE macros instead.
17740 
17741  The default SYS_MESSAGE and SYS_DEBUG_MESSAGE macro definitions remove
17742  the messages and message function calls from the source code. To access
17743  and utilize the messages, define the SYS_DEBUG_USE_CONSOLE macro or
17744  override the definitions of the individual macros.
17745 */
17746 
17747 void
17749  const char * message ) ;
17750 // *****************************************************************************
17751 /* Function:
17752  SYS_DEBUG_Print( const char* format, ... )
17753  Summary:
17754  Formats and prints a message with a variable number of arguments to the
17755  console regardless of the system error level.
17756  Description:
17757  This function formats and prints a message with a variable number of
17758  arguments to the console regardless of the system error level. It can be
17759  used to implement the SYS_PRINT and SYS_DEBUG_PRINT macros.
17760  Precondition:
17761  SYS_DEBUG_Initialize must have returned a valid object handle and the
17762  SYS_DEBUG_Tasks function must be called by the system to complete the
17763  message request.
17764  Parameters:
17765  format - Pointer to a buffer containing the format string for
17766  the message to be displayed.
17767  ... - Zero or more optional parameters to be formated as
17768  defined by the format string.
17769  Returns:
17770  None.
17771  Example:
17772  <code>
17773  // In system_config.h
17774 #define SYS_PRINT(format, ...) SYS_DEBUG_Print(format, ##__VA_ARG__)
17775 
17776  // In source code
17777  int result;
17778 
17779  result = SomeOperation();
17780  if (result > MAX_VALUE)
17781  {
17782  SYS_PRINT("Result of %d exceeds max value\r\n", result);
17783  }
17784  </code>
17785  Remarks:
17786  The format string and arguments follow the printf convention.
17787 
17788  Do not call this function directly. Call the SYS_PRINT or SYS_DEBUG_PRINT
17789  macros instead.
17790 
17791  The default SYS_PRINT and SYS_DEBUG_PRINT macro definitions remove the
17792  messages and message function calls. To access and utilize the messages,
17793  define the SYS_DEBUG_USE_CONSOLE macro or override the definitions of the
17794  individual macros.
17795 */
17796 
17797 void
17798  SYS_DEBUG_Print (
17799  const char * format ,
17800  ... ) ;
17801 // *****************************************************************************
17802 /* Function:
17803  void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level);
17804  Summary:
17805  Sets the global system error reporting level.
17806  Description:
17807  This function sets the global system error reporting level.
17808 
17809  Precondition:
17810  SYS_DEBUG_Initialize must have returned a valid object handle.
17811  Parameters:
17812  level - The desired system error level.
17813  Returns:
17814  None.
17815  Example:
17816  <code>
17817  SYS_DEBUG_ErrorLevelSet(SYS_ERROR_WARNING);
17818  </code>
17819  Remarks:
17820  None.
17821 */
17822 
17823 void
17825  SYS_ERROR_LEVEL level ) ;
17826 // *****************************************************************************
17827 /* Function:
17828  SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void);
17829  Summary:
17830  Returns the global system Error reporting level.
17831  Description:
17832  This function returns the global System Error reporting level.
17833 
17834  Precondition:
17835  SYS_DEBUG_Initialize must have returned a valid object handle.
17836  Parameters:
17837  None.
17838  Returns:
17839  The global System Error Level.
17840  Example:
17841  <code>
17842  SYS_ERROR_LEVEL level;
17843 
17844  level = SYS_DEBUG_ErrorLevelGet();
17845  </code>
17846  Remarks:
17847  None.
17848 */
17849 
17851  SYS_DEBUG_ErrorLevelGet ( void ) ;
17852 // *****************************************************************************
17853 // *****************************************************************************
17854 // Section: SYS DEBUG Macros
17855 // *****************************************************************************
17856 // *****************************************************************************
17857 // *****************************************************************************
17858 /* Macro:
17859  _SYS_DEBUG_MESSAGE( SYS_ERROR_LEVEL level, const char* message )
17860  Summary:
17861  Prints a debug message if the specified level is at or below the global
17862  system error level.
17863  Description:
17864  This macro prints a debug message if the specified level is at or below the
17865  global error level. It can be used to implement the SYS_DEBUG_MESSAGE macro.
17866  Precondition:
17867  SYS_DEBUG_Initialize must have returned a valid object handle.
17868  Parameters:
17869  level - The current error level threshold for displaying the message.
17870  message - Pointer to a buffer containing the message to be displayed.
17871  Returns:
17872  None.
17873  Example:
17874  <code>
17875  // In system_config.h
17876 #define SYS_DEBUG_MESSAGE(level,message) _SYS_DEBUG_MESSAGE(level,message)
17877 
17878  // In library source (.c) code.
17879  SYS_DEBUG_MESSAGE(SYS_ERROR_WARNING, "My debug warning message\n\r");
17880  </code>
17881  Remarks:
17882  Do not call this macro directly. Call the SYS_DEBUG_MESSAGE macro instead.
17883 
17884  The default SYS_DEBUG_MESSAGE macro definition removes the message and
17885  function call from the source code. To access and utilize the message,
17886  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
17887  SYS_DEBUG_MESSAGE macro.
17888 */
17889 #define _SYS_DEBUG_MESSAGE( level , message ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Message ( message ) ; } while ( 0 )
17890 // *****************************************************************************
17891 /* Macro:
17892  _SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
17893  Summary:
17894  Formats and prints a debug message if the specified level is at or below the
17895  global system error level.
17896  Description:
17897  This function formats and prints a debug message if the specified level is
17898  at or below the global system error level. It can be used to implement the
17899  SYS_DEBUG_PRINT macro.
17900  Precondition:
17901  SYS_DEBUG_Initialize must have returned a valid object handle.
17902  Parameters:
17903  level - The current error level threshold for displaying the message.
17904  format - Pointer to a buffer containing the format string for
17905  the message to be displayed.
17906  ... - Zero or more optional parameters to be formated as
17907  defined by the format string.
17908  Returns:
17909  None.
17910  Example:
17911  <code>
17912  // In system_config.h
17913 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
17914 
17915  // In source code
17916  int result;
17917 
17918  result = SomeOperation();
17919  if (result > MAX_VALUE)
17920  {
17921  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
17922  // Take appropriate action
17923  }
17924  </code>
17925  Remarks:
17926  Do not call this macro directly. Call the SYS_DEBUG_PRINT macro instead.
17927 
17928  The default SYS_DEBUG_PRINT macro definition removes the message and
17929  function call from the source code. To access and utilize the message,
17930  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
17931  SYS_DEBUG_PRINT macro.
17932 */
17933 #define _SYS_DEBUG_PRINT( level , format ,... ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Print ( format , ## __VA_ARGS__ ) ; } while ( 0 )
17934 // DOM-IGNORE-BEGIN
17935 // *****************************************************************************
17936 /* These definitions support the SYS_DEBUG_USE_CONSOLE build-time configuration
17937  option. Defining SYS_DEBUG_USE_CONSOLE in the system configuration
17938  (system_config.h) will map the macros below to the appropriate system
17939  console functions.
17940 */
17941 // DOM-IGNORE-END
17942 // *****************************************************************************
17943 /* Macro:
17944  SYS_MESSAGE( const char* message )
17945  Summary:
17946  Prints a message to the console regardless of the system error level.
17947  Description:
17948  This macro is used to print a message to the console regardless of the
17949  system error level. It can be mapped to any desired implementation.
17950  Precondition:
17951  If mapped to the _SYS_MESSAGE function, then the system debug service must
17952  be initialized and running.
17953  Parameters:
17954  message - Pointer to a buffer containing the message string to be
17955  displayed.
17956  Returns:
17957  None.
17958  Example:
17959  <code>
17960  // In system_config.h:
17961 #define SYS_MESSAGE(message) _SYS_MESSAGE(message)
17962 
17963  // In source (.c) files:
17964  SYS_MESSAGE("My Message\n\r");
17965  </code>
17966  Remarks:
17967  By default, this macro is defined as nothing, effectively removing all code
17968  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
17969  defined in a way that maps calls to it to the desired implementation (see
17970  example, above).
17971 
17972  This macro can be mapped to the system console service (along with other
17973  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
17974  configuration (system_config.h) instead of defining it individually.
17975 */
17976 #define SYS_MESSAGE( message )
17977 // *****************************************************************************
17978 /* Function:
17979  SYS_DEBUG_MESSAGE( const char* message )
17980  Summary:
17981  Prints a debug message if the system error level is defined defined at
17982  or lower than the level specified.
17983  Description:
17984  This function prints a debug message if the system error level is defined at
17985  or lower than the level specified.
17986  Precondition:
17987  SYSTEM_CURRENT_ERROR_LEVEL must be defined as SYS_ERROR_DEBUG.
17988  Parameters:
17989  level - The current error level threshold for displaying the message.
17990  message - Pointer to a buffer containing the message to be displayed.
17991  Returns:
17992  None.
17993  Example:
17994  <code>
17995 #define SYS_DEBUG_MESSAGE _SYS_DEBUG_MESSAGE
17996  SYS_ERROR_LevelSet(SYS_ERROR_DEBUG);
17997  SYS_DEBUG_MESSAGE("System Debug Message \n\r");
17998  </code>
17999  Remarks:
18000  By default, this macro is defined as nothing, effectively removing all code
18001  generated by calls to it. To process SYS_DEBUG_MESSAGE calls, this macro
18002  must be defined in a way that maps calls to it to the desired implementation
18003  (see example, above).
18004 
18005  This macro can be mapped to the system console service (along with other
18006  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18007  configuration (system_config.h) instead of defining it individually.
18008 */
18009 #define SYS_DEBUG_MESSAGE( level , message )
18010 // *****************************************************************************
18011 /* Function:
18012  SYS_PRINT(const char* format, ...);
18013  Summary:
18014  Formats and prints an error message with a variable number of arguments
18015  regardless of the system error level.
18016  Description:
18017  This function formats and prints an error message with a variable number of
18018  if the system error level is defined at or lower than the level specified.
18019  Precondition:
18020  SYSTEM_CURRENT_ERROR_LEVEL must be defined.
18021  Parameters:
18022  format - Pointer to a buffer containing the format string for
18023  the message to be displayed.
18024  ... - Zero or more optional parameters to be formated as
18025  defined by the format string.
18026  Returns:
18027  None.
18028  Example:
18029  <code>
18030  // In system_config.h
18031 #define SYS_PRINT(format, ...) _SYS_DEBUG_PRINT(format, ##__VA_ARG__)
18032 
18033  // In source code
18034  int result;
18035 
18036  result = SomeOperation();
18037  if (result > MAX_VALUE)
18038  {
18039  SYS_PRINT("Result of %d exceeds max value\r\n", result);
18040  // Take appropriate action
18041  }
18042  </code>
18043  Remarks:
18044  The format string and arguments follow the printf convention. This function
18045  is called by the macros SYS_PRINT and SYS_ERROR_PRINT
18046 
18047  By default, this macro is defined as nothing, effectively removing all code
18048  generated by calls to it. To process SYS_PRINT calls, this macro must be
18049  defined in a way that maps calls to it to the desired implementation (see
18050  example, above).
18051 
18052  This macro can be mapped to the system console service (along with other
18053  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18054  configuration (system_config.h) instead of defining it individually.
18055 */
18056 #define SYS_PRINT( fmt ,... )
18057 // *****************************************************************************
18058 /* Macro:
18059  SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
18060  Summary:
18061  Formats and prints an error message if the system error level is defined at
18062  or lower than the level specified.
18063  Description:
18064  This macro formats and prints an error message if the system error level
18065  is defined at or lower than the level specified.o
18066  Precondition:
18067  SYS_DEBUG_Initialize must have returned a valid object handle.
18068  Parameters:
18069  level - The current error level threshold for displaying the message.
18070  format - Pointer to a buffer containing the format string for
18071  the message to be displayed.
18072  ... - Zero or more optional parameters to be formated as
18073  defined by the format string.
18074  Returns:
18075  None.
18076  Example:
18077  <code>
18078  // In system_config.h
18079 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
18080 
18081  // In source code
18082  int result;
18083 
18084  result = SomeOperation();
18085  if (result > MAX_VALUE)
18086  {
18087  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
18088  // Take appropriate action
18089  }
18090  </code>
18091  Remarks:
18092  The format string and arguments follow the printf convention. This function
18093  is called by the macros SYS_PRINT and SYS_DEBUG_PRINT.
18094 
18095  By default, this macro is defined as nothing, effectively removing all code
18096  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
18097  defined in a way that maps calls to it to the desired implementation (see
18098  example, above).
18099 
18100  This macro can be mapped to the system console service (along with other
18101  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18102  configuration (system_config.h) instead of defining it individually.
18103 */
18104 #define SYS_DEBUG_PRINT( level , fmt ,... )
18105 // *****************************************************************************
18106 /* Macro:
18107  SYS_DEBUG_BreakPoint( void )
18108  Summary:
18109  Inserts a software breakpoint instruction when building in Debug mode.
18110  Description:
18111  This macro inserts a software breakpoint instruction when building in Debug
18112  mode.
18113  Precondition:
18114  None.
18115  Parameters:
18116  None.
18117  Returns:
18118  None.
18119  Example:
18120  <code>
18121  if (myDebugTestFailed)
18122  {
18123  SYS_DEBUG_BreakPoint();
18124  }
18125  </code>
18126  Remarks:
18127  Compiles out if not built for debugging.
18128 */
18129 #define SYS_DEBUG_BreakPoint( )
18130 // *****************************************************************************
18131 // *****************************************************************************
18132 // Section: SYS DEBUG Deprecated Macros
18133 // *****************************************************************************
18134 // *****************************************************************************
18135 /* Do not use these macros for new development.
18136 */
18137 //DOM-IGNORE-BEGIN
18138 #define SYS_DEBUG( level , message ) SYS_DEBUG_MESSAGE ( level , message )
18139 #define SYS_ERROR( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18140 #define SYS_ERROR_PRINT( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18141 //DOM-IGNORE-END
18142  // _SYS_DEBUG_H
18143 /*******************************************************************************
18144  End of File
18145 */
18146 #endif /*00 C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h*/
18147 /* CLOSE_FILE Include File */
18148 
18149 // DOM-IGNORE-BEGIN
18150 // DOM-IGNORE-END
18151 // *****************************************************************************
18152 // *****************************************************************************
18153 // Section: Data Type Definitions
18154 // *****************************************************************************
18155 // *****************************************************************************
18156 /* USART FIFO+RX(8+1) size */
18157 #define _DRV_USART_RX_DEPTH 9
18158 // *****************************************************************************
18159 /* USART Static Driver Instance Object
18160  Summary:
18161  Object used to keep any data required for the static USART driver.
18162  Description:
18163  This object is used to keep track of any data that must be maintained to
18164  manage the USART static driver.
18165  Remarks:
18166  None.
18167 */
18168 
18169 typedef
18170  struct
18171  {
18172  /* Client specific error */
18173  DRV_USART_ERROR error ;
18174  } DRV_USART_OBJ ;
18175 // *****************************************************************************
18176 // *****************************************************************************
18177 // Section: Local functions.
18178 // *****************************************************************************
18179 // *****************************************************************************
18180 // DOM-IGNORE-BEGIN
18181 // DOM-IGNORE-END
18182  //#ifndef _DRV_USART_STATIC_LOCAL_H
18183 /*******************************************************************************
18184  End of File
18185 */
18186 
18187 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h*/
18188 /* CLOSE_FILE Include File */
18189 
18190 // DOM-IGNORE-BEGIN
18191 // DOM-IGNORE-END
18192 // *********************************************************************************************
18193 // *********************************************************************************************
18194 // Section: System Interface Headers for the Instance 0 of USART static driver
18195 // *********************************************************************************************
18196 // *********************************************************************************************
18197 
18198 SYS_MODULE_OBJ
18199  DRV_USART0_Initialize ( void ) ;
18200 
18201 void
18202  DRV_USART0_Deinitialize ( void ) ;
18203 
18204 SYS_STATUS
18205  DRV_USART0_Status ( void ) ;
18206 
18207 void
18208  DRV_USART0_TasksTransmit ( void ) ;
18209 
18210 void
18211  DRV_USART0_TasksReceive ( void ) ;
18212 
18213 void
18214  DRV_USART0_TasksError ( void ) ;
18215 // *********************************************************************************************
18216 // *********************************************************************************************
18217 // Section: General Client Interface Headers for the Instance 0 of USART static driver
18218 // *********************************************************************************************
18219 // *********************************************************************************************
18220 
18221 DRV_HANDLE
18222  DRV_USART0_Open (
18223  const SYS_MODULE_INDEX index ,
18224  const DRV_IO_INTENT ioIntent ) ;
18225 
18226 void
18227  DRV_USART0_Close ( void ) ;
18228 
18230  DRV_USART0_ClientStatus ( void ) ;
18231 
18233  DRV_USART0_TransferStatus ( void ) ;
18234 
18236  DRV_USART0_ErrorGet ( void ) ;
18237 // *********************************************************************************************
18238 // *********************************************************************************************
18239 // Section: Byte Model Client Interface Headers for the Instance 0 of USART static driver
18240 // *********************************************************************************************
18241 // *********************************************************************************************
18242 
18243 uint8_t
18244  DRV_USART0_ReadByte ( void ) ;
18245 
18246 void
18248  const uint8_t byte ) ;
18249 
18250 unsigned int
18252 
18253 unsigned int
18255 
18256 bool
18258 
18259 bool
18261 // *********************************************************************************************
18262 // *********************************************************************************************
18263 // Section: Set up Client Interface Headers for the Instance 0 of USART static driver
18264 // *********************************************************************************************
18265 // *********************************************************************************************
18266 
18269  uint32_t baud ) ;
18270 
18273  DRV_USART_LINE_CONTROL lineControlMode ) ;
18274 // DOM-IGNORE-BEGIN
18275 // DOM-IGNORE-END
18276  // #ifndef _DRV_USART_STATIC_H
18277 /*******************************************************************************
18278  End of File
18279 */
18280 
18281 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h*/
18282 /* CLOSE_FILE Include File */
18283 
18284 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h */
18285 /*******************************************************************************
18286  Ports System Service Interface Definition
18287  Company:
18288  Microchip Technology Inc.
18289  File Name:
18290  sys_ports.h
18291  Summary:
18292  Ports System Service interface definitions
18293  Description:
18294  This file contains the interface definition for the Ports system
18295  service. It provides a way to interact with the Ports subsystem to
18296  manage the timing requests supported by the system
18297 *******************************************************************************/
18298 //DOM-IGNORE-BEGIN
18299 /*******************************************************************************
18300 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18301 Microchip licenses to you the right to use, modify, copy and distribute
18302 Software only when embedded on a Microchip microcontroller or digital signal
18303 controller that is integrated into your product or third party product
18304 (pursuant to the sublicense terms in the accompanying license agreement).
18305 You should refer to the license agreement accompanying this Software for
18306 additional information regarding your rights and obligations.
18307 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18308 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18309 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18310 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18311 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18312 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18313 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18314 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18315 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18316 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18317 *******************************************************************************/
18318 //DOM-IGNORE-END
18319 #ifndef _SYS_PORTS_H
18320 #define _SYS_PORTS_H
18321 // *****************************************************************************
18322 // *****************************************************************************
18323 // Section: Included Files
18324 // *****************************************************************************
18325 // *****************************************************************************
18326 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h */
18327 /*******************************************************************************
18328  PORTS System Service Library Interface Definition
18329  Company:
18330  Microchip Technology Inc.
18331  File Name:
18332  sys_ports_definitions.h
18333  Summary:
18334  PORTS System Service data type definitions header.
18335  Description:
18336  This file contains data type definitions header.
18337 *******************************************************************************/
18338 //DOM-IGNORE-BEGIN
18339 /*******************************************************************************
18340 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18341 Microchip licenses to you the right to use, modify, copy and distribute
18342 Software only when embedded on a Microchip microcontroller or digital signal
18343 controller that is integrated into your product or third party product
18344 (pursuant to the sublicense terms in the accompanying license agreement).
18345 You should refer to the license agreement accompanying this Software for
18346 additional information regarding your rights and obligations.
18347 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18348 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18349 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18350 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18351 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18352 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18353 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18354 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18355 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18356 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18357 *******************************************************************************/
18358 //DOM-IGNORE-END
18359 #ifndef _SYS_PORTS_DEFINITIONS_H
18360 #define _SYS_PORTS_DEFINITIONS_H
18361 // *****************************************************************************
18362 // *****************************************************************************
18363 // Section: File includes
18364 // *****************************************************************************
18365 // *****************************************************************************
18366 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
18367 #include "system/common/sys_common.h"
18368 #include "system/common/sys_module.h"
18369 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h */
18370 /*******************************************************************************
18371  Ports Peripheral Library Interface Header
18372  Company:
18373  Microchip Technology Inc.
18374  File Name:
18375  plib_ports.h
18376  Summary:
18377  Ports Peripheral Library Interface header for Ports function definitions.
18378  Description:
18379  This header file contains the function prototypes and definitions of
18380  the data types and constants that make up the interface to the Ports
18381  Peripheral Library for all families of Microchip microcontrollers. The
18382  definitions in this file are common to the Ports peripheral.
18383 *******************************************************************************/
18384 // DOM-IGNORE-BEGIN
18385 /*******************************************************************************
18386 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
18387 Microchip licenses to you the right to use, modify, copy and distribute
18388 Software only when embedded on a Microchip microcontroller or digital signal
18389 controller that is integrated into your product or third party product
18390 (pursuant to the sublicense terms in the accompanying license agreement).
18391 You should refer to the license agreement accompanying this Software for
18392 additional information regarding your rights and obligations.
18393 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18394 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18395 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18396 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18397 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18398 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18399 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18400 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18401 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18402 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18403 *******************************************************************************/
18404 // DOM-IGNORE-END
18405 #ifndef _PLIB_PORTS_H
18406 #define _PLIB_PORTS_H
18407 #include <stdint.h>
18408 #include <stddef.h>
18409 // DOM-IGNORE-BEGIN
18410 // DOM-IGNORE-END
18411 // *****************************************************************************
18412 // *****************************************************************************
18413 // Section: Constants & Data Types
18414 // *****************************************************************************
18415 // *****************************************************************************
18416 // *****************************************************************************
18417 /* Ports data mask definition
18418  Summary:
18419  Data type defining the Ports data mask
18420  Description:
18421  This data type defines the Ports data mask
18422  Remarks:
18423  None.
18424 */
18425 
18426 typedef
18427 uint16_t
18429 // *****************************************************************************
18430 /* Ports data type definition
18431  Summary:
18432  Data type defining the Ports data type.
18433  Description:
18434  This data type defines the Ports data type.
18435  Remarks:
18436  None.
18437 */
18438 
18439 typedef
18440 uint32_t
18442 // *****************************************************************************
18443 // *****************************************************************************
18444 // Section: Included Files (continued at end of file)
18445 // *****************************************************************************
18446 // *****************************************************************************
18447 /* This section lists the other files that are included in this file. However,
18448  please see the end of the file for additional implementation header files
18449  that are also included.
18450 */
18451 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h */
18452 //DOM-IGNORE-BEGIN
18453 /*******************************************************************************
18454 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
18455 Microchip licenses to you the right to use, modify, copy and distribute
18456 Software only when embedded on a Microchip microcontroller or digital signal
18457 controller that is integrated into your product or third party product
18458 (pursuant to the sublicense terms in the accompanying license agreement).
18459 You should refer to the license agreement accompanying this Software for
18460 additional information regarding your rights and obligations.
18461 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
18462 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18463 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18464 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18465 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18466 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18467 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18468 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18469 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18470 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18471  *******************************************************************************/
18472 //DOM-IGNORE-END
18473 #ifndef _PLIB_PORTS_PROCESSOR_H
18474 #define _PLIB_PORTS_PROCESSOR_H
18475 #error "Can't find header"
18476 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h*/
18477 /* CLOSE_FILE Include File */
18478 
18479 // *****************************************************************************
18480 // *****************************************************************************
18481 // Section: Ports Peripheral Library Interface Routines
18482 // *****************************************************************************
18483 // *****************************************************************************
18484 // *****************************************************************************
18485 /* Function:
18486  void PLIB_PORTS_RemapInput( PORTS_MODULE_ID index,
18487  PORTS_REMAP_INPUT_FUNCTION inputFunction,
18488  PORTS_REMAP_INPUT_PIN remapInputPin );
18489  Summary:
18490  Input function remapping.
18491  Description:
18492  This function controls the Input function remapping. It allows user to map
18493  any of the input functionality on any of the remappable input pin.
18494  This function does not perform atomic register access.
18495  Precondition:
18496  IOLOCK bit of configuration register should be clear to allow any remapping.
18497  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18498  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18499  find more information.
18500  Parameters:
18501  index - Identifier for the device instance to be configured
18502  inputFunction - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
18503  remapInputPin - One of the possible values of PORTS_REMAP_INPUT_PIN
18504  Returns:
18505  None.
18506  Example:
18507  <code>
18508 
18509  // System Unlock
18510  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18511  // Unlock PPS registers
18512  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18513  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
18514  PLIB_PORTS_RemapInput(PORTS_ID_0, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
18515  </code>
18516  Remarks:
18517  This feature may not be available on all devices. Please refer to the
18518  specific device data sheet to determine availability or use
18519  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18520  this feature is available.
18521 */
18522 
18523 void
18525  PORTS_MODULE_ID index ,
18526  PORTS_REMAP_INPUT_FUNCTION inputFunction ,
18527  PORTS_REMAP_INPUT_PIN remapInputPin ) ;
18528 // *****************************************************************************
18529 /* Function:
18530  void PLIB_PORTS_RemapOutput( PORTS_MODULE_ID index,
18531  PORTS_REMAP_OUTPUT_FUNCTION outputFunction,
18532  PORTS_REMAP_OUTPUT_PIN remapOutputPin );
18533  Summary:
18534  Output function remapping.
18535  Description:
18536  This function controls the Output function remapping. it allows user to map
18537  any of the output functionality on any of the remappable output pin.
18538  This function does not perform atomic register access.
18539  Precondition:
18540  IOLOCK bit of configuration register should be clear to allow any remapping.
18541  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18542  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18543  find more information.
18544  Parameters:
18545  index - Identifier for the device instance to be configured
18546  outputFunction - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
18547  remapOutputPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
18548  Returns:
18549  None.
18550  Example:
18551  <code>
18552 
18553  // System Unlock
18554  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18555  // Unlock PPS registers
18556  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18557  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
18558  PLIB_PORTS_RemapOutput(PORTS_ID_0, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
18559 
18560  </code>
18561  Remarks:
18562  This feature may not be available on all devices. Please refer to the
18563  specific device data sheet to determine availability or use
18564  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18565  this feature is available.
18566 */
18567 
18568 void
18570  PORTS_MODULE_ID index ,
18571  PORTS_REMAP_OUTPUT_FUNCTION outputFunction ,
18572  PORTS_REMAP_OUTPUT_PIN remapOutputPin ) ;
18573 // *****************************************************************************
18574 /* Function:
18575  void PLIB_PORTS_PinModeSelect( PORTS_MODULE_ID index,
18576  PORTS_ANALOG_PIN pin,
18577  PORTS_PIN_MODE mode );
18578  Summary:
18579  Enables the selected pin as analog or digital.
18580  Description:
18581  This function enables the selected pin as analog or digital.
18582  This function does not perform atomic register access.
18583  Precondition:
18584  None.
18585  Parameters:
18586  index - Identifier for the device instance to be configured
18587  pin - Possible values of PORTS_ANALOG_PIN
18588  mode - Possible values of PORTS_PIN_MODE
18589  Returns:
18590  None.
18591  Example:
18592  <code>
18593 
18594  // Make AN0 pin as Analog
18595  PLIB_PORTS_PinModeSelect(PORTS_ID_0, PORTS_ANALOG_PIN_0, PORTS_PIN_MODE_ANALOG);
18596 
18597  </code>
18598  Remarks:
18599  This feature may not be available on all devices. Please refer to the
18600  specific device data sheet to determine availability or use
18601  PLIB_PORTS_ExistsPinMode in your application to determine whether
18602  this feature is available.
18603 */
18604 
18605 void
18607  PORTS_MODULE_ID index ,
18608  PORTS_ANALOG_PIN pin ,
18609  PORTS_PIN_MODE mode ) ;
18610 // *****************************************************************************
18611 /* Function:
18612  void PLIB_PORTS_PinModePerPortSelect( PORTS_MODULE_ID index,
18613  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos,
18614  PORTS_PIN_MODE mode );
18615  Summary:
18616  Enables the selected port pin as analog or digital.
18617  Description:
18618  This function enables the selected port pin as analog or digital.
18619  This function does not perform atomic register access.
18620  Precondition:
18621  None.
18622  Parameters:
18623  index - Identifier for the device instance to be configured
18624  channel - Port pin channel
18625  bitPos - Position in the PORT pins
18626  mode - Possible values of PORTS_PIN_MODE
18627  Returns:
18628  None.
18629  Example:
18630  <code>
18631 
18632  // Make RC5 pin Analog
18633  PLIB_PORTS_PinModePerPortSelect(PORTS_ID_0, PORT_CHANNEL_C,
18634  PORTS_BIT_POS_5, PORTS_PIN_MODE_ANALOG);
18635 
18636  </code>
18637  Remarks:
18638  This function is only available in devices with PPS. For Non-PPS devices, use the
18639  PLIB_PORTS_PinModeSelect function.
18640 
18641  This feature may not be available on all devices. Please refer to the
18642  specific device data sheet to determine availability or use
18643  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
18644  this feature is available.
18645 */
18646 
18647 void
18649  PORTS_MODULE_ID index ,
18650  PORTS_CHANNEL channel ,
18651  PORTS_BIT_POS bitPos ,
18652  PORTS_PIN_MODE mode ) ;
18653 // *****************************************************************************
18654 /* Function:
18655  void PLIB_PORTS_ChangeNoticePullDownPerPortEnable( PORTS_MODULE_ID index,
18656  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18657  Summary:
18658  Enables the pull-down for selected Change Notice pins.
18659  Description:
18660  This function enables the pull-down for selected Change Notice pins.
18661  This function does not perform atomic register access.
18662  Precondition:
18663  None.
18664  Parameters:
18665  index - Identifier for the device instance to be configured
18666  channel - Port pin channel
18667  bitPos - Position in the PORT pins
18668  Returns:
18669  None.
18670  Example:
18671  <code>
18672 
18673  // Enable pull-down for RC5 pin
18674  PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18675  PORTS_BIT_POS_5);
18676 
18677  </code>
18678  Remarks:
18679  This feature may not be available on all devices. Please refer to the
18680  specific device data sheet to determine availability or use
18681  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
18682  determine whether this feature is available.
18683 */
18684 
18685 void
18687  PORTS_MODULE_ID index ,
18688  PORTS_CHANNEL channel ,
18689  PORTS_BIT_POS bitPos ) ;
18690 // *****************************************************************************
18691 /* Function:
18692  void PLIB_PORTS_ChangeNoticePullDownPerPortDisable( PORTS_MODULE_ID index,
18693  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18694  Summary:
18695  Disables the pull-down for selected Change Notice pins.
18696  Description:
18697  This function disables the pull-down for selected Change Notice pins.
18698  This function does not perform atomic register access.
18699  Precondition:
18700  None.
18701  Parameters:
18702  index - Identifier for the device instance to be configured
18703  channel - Port pin channel
18704  bitPos - Position in the PORT pins
18705  Returns:
18706  None.
18707  Example:
18708  <code>
18709 
18710  // Disable pull-down for RC5 pin
18711  PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18712  PORTS_BIT_POS_5);
18713  </code>
18714  Remarks:
18715  This feature may not be available on all devices. Please refer to the
18716  specific device data sheet to determine availability or use
18717  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
18718  determine whether this feature is available.
18719 */
18720 
18721 void
18723  PORTS_MODULE_ID index ,
18724  PORTS_CHANNEL channel ,
18725  PORTS_BIT_POS bitPos ) ;
18726 // *****************************************************************************
18727 /* Function:
18728  void PLIB_PORTS_ChangeNoticePullUpPerPortEnable ( PORTS_MODULE_ID index,
18729  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18730  Summary:
18731  Enables the pull-up for selected Change Notice pins.
18732  Description:
18733  This function enables the pull-up for selected Change Notice pins.
18734  This function does not perform atomic register access.
18735  Precondition:
18736  None.
18737  Parameters:
18738  index - Identifier for the device instance to be configured
18739  channel - Port pin channel
18740  bitPos - Position in the PORT pins
18741  Returns:
18742  None.
18743  Example:
18744  <code>
18745 
18746  // Enable pull-up for RC5 pin
18747  PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18748  PORTS_BIT_POS_5);
18749  </code>
18750  Remarks:
18751  This function is only available in devices with PPS. For Non-PPS devices, use the
18752  PLIB_PORTS_ChangeNoticePullUpEnable function.
18753 
18754  This feature may not be available on all devices. Please refer to the
18755  specific device data sheet to determine availability or use
18756  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
18757  determine whether this feature is available.
18758 */
18759 
18760 void
18762  PORTS_MODULE_ID index ,
18763  PORTS_CHANNEL channel ,
18764  PORTS_BIT_POS bitPos ) ;
18765 // *****************************************************************************
18766 /* Function:
18767  void PLIB_PORTS_ChangeNoticePullUpPerPortDisable( PORTS_MODULE_ID index,
18768  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
18769  Summary:
18770  Disables weak pull-up for the selected pin.
18771  Description:
18772  This function disables weak pull-up for the selected port pin.
18773  This function does not perform atomic register access.
18774  Precondition:
18775  None.
18776  Parameters:
18777  index - Identifier for the device instance to be configured
18778  channel - Port pin channel
18779  bitPos - Position in the PORT pins
18780  Returns:
18781  None.
18782  Example:
18783  <code>
18784 
18785  // Disable pull-up for RC5 pin
18786  PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18787  PORTS_BIT_POS_5);
18788 
18789  </code>
18790  Remarks:
18791  This function is only available in devices with PPS. For Non-PPS devices, use the
18792  PLIB_PORTS_ChangeNoticePullUpDisable function.
18793 
18794  Pull-ups on change notification pins should always be disabled when the
18795  port pin is configured as a digital output.
18796 
18797  This feature may not be available on all devices. Please refer to the
18798  specific device data sheet to determine availability or use
18799  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
18800  determine whether this feature is available.
18801 */
18802 
18803 void
18805  PORTS_MODULE_ID index ,
18806  PORTS_CHANNEL channel ,
18807  PORTS_BIT_POS bitPos ) ;
18808 // *****************************************************************************
18809 /* Function:
18810  void PLIB_PORTS_PinChangeNoticePerPortEnable ( PORTS_MODULE_ID index,
18811  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18812  Summary:
18813  Enables CN interrupt for the selected pin.
18814  Description:
18815  This function enables Change Notice interrupt for the selected port pin.
18816  This function does not perform atomic register access.
18817 
18818  Precondition:
18819  None.
18820  Parameters:
18821  index - Identifier for the device instance to be configured
18822  channel - Port pin channel
18823  bitPos - Position in the PORT pins
18824  Returns:
18825  None.
18826  Example:
18827  <code>
18828 
18829  // Enable CN interrupt for RC5 pin
18830  PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18831  PORTS_BIT_POS_5);
18832 
18833  </code>
18834  Remarks:
18835  This function is only available in devices with PPS. For Non-PPS devices, use the
18836  PLIB_PORTS_PinChangeNoticeEnable function.
18837 
18838  This feature may not be available on all devices. Please refer to the
18839  specific device data sheet to determine availability or use
18840  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
18841  determine whether this feature is available.
18842 */
18843 
18844 void
18846  PORTS_MODULE_ID index ,
18847  PORTS_CHANNEL channel ,
18848  PORTS_BIT_POS bitPos ) ;
18849 // *****************************************************************************
18850 /* Function:
18851  void PLIB_PORTS_PinChangeNoticePerPortDisable( PORTS_MODULE_ID index,
18852  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18853  Summary:
18854  Disables CN interrupt for the selected pin.
18855  Description:
18856  This function disables Change Notice interrupt for the selected port pin.
18857  This function does not perform atomic register access.
18858  Precondition:
18859  None.
18860  Parameters:
18861  index - Identifier for the device instance to be configured
18862  channel - Port pin channel
18863  bitPos - Position in the PORT pins
18864  Returns:
18865  None.
18866  Example:
18867  <code>
18868 
18869  // Disable CN interrupt for RC5 pin
18870  PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18871  PORTS_BIT_POS_5);
18872 
18873  </code>
18874  Remarks:
18875  This function is only available in devices with PPS. For Non-PPS devices, use the
18876  PLIB_PORTS_PinChangeNoticeDisable function.
18877 
18878  This feature may not be available on all devices. Please refer to the
18879  specific device data sheet to determine availability or use
18880  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
18881  determine whether this feature is available.
18882 */
18883 
18884 void
18886  PORTS_MODULE_ID index ,
18887  PORTS_CHANNEL channel ,
18888  PORTS_BIT_POS bitPos ) ;
18889 // *****************************************************************************
18890 /* Function:
18891  void PLIB_PORTS_ChangeNoticePerPortTurnOn ( PORTS_MODULE_ID index,
18892  PORTS_CHANNEL channel );
18893  Summary:
18894  Enables the change notification for selected port.
18895  Description:
18896  This function enables the change notification for selected port.
18897  This function does not perform atomic register access.
18898  Precondition:
18899  None.
18900  Parameters:
18901  index - Identifier for the device instance to be configured
18902  channel - Port pin channel
18903  Returns:
18904  None.
18905  Example:
18906  <code>
18907  // Enable Change notification for Port C
18908  PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_ID_0, PORT_CHANNEL_C);
18909 
18910  </code>
18911  Remarks:
18912  This function is only available in devices with PPS. For Non-PPS devices, use the
18913  PLIB_PORTS_ChangeNoticeEnable function.
18914 
18915  This feature may not be available on all devices. Please refer to the
18916  specific device data sheet to determine availability or use
18917  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
18918  whether this feature is available.
18919 */
18920 
18921 void
18923  PORTS_MODULE_ID index ,
18924  PORTS_CHANNEL channel ) ;
18925 // *****************************************************************************
18926 /* Function:
18927  void PLIB_PORTS_ChangeNoticePerPortTurnOff( PORTS_MODULE_ID index,
18928  PORTS_CHANNEL channel );
18929  Summary:
18930  Disables the change notification for selected port.
18931  Description:
18932  This function disables the change notification for selected port.
18933  This function does not perform atomic register access.
18934  Precondition:
18935  None.
18936  Parameters:
18937  index - Identifier for the device instance to be configured
18938  channel - Port pin channel
18939  Returns:
18940  None.
18941  Example:
18942  <code>
18943  // Disable Change notification for Port C
18944  PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_ID_0, PORT_CHANNEL_C);
18945 
18946  </code>
18947  Remarks:
18948  This function is only available in devices with PPS. For Non-PPS devices, use the
18949  PLIB_PORTS_ChangeNoticeDisable function.
18950 
18951  This feature may not be available on all devices. Please refer to the
18952  specific device data sheet to determine availability or use
18953  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
18954  whether this feature is available.
18955 */
18956 
18957 void
18959  PORTS_MODULE_ID index ,
18960  PORTS_CHANNEL channel ) ;
18961 // *****************************************************************************
18962 /* Function:
18963  void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable ( PORTS_MODULE_ID index,
18964  PORTS_CHANNEL channel );
18965  Summary:
18966  Allows CN to be working in Idle mode for selected channel.
18967  Description:
18968  This function makes sure that change notification feature keeps working in
18969  Idle mode for the selected channel.
18970  This function does not perform atomic register access.
18971  Precondition:
18972  None.
18973  Parameters:
18974  index - Identifier for the device instance to be configured
18975  channel - Port pin channel
18976  Returns:
18977  None.
18978  Example:
18979  <code>
18980 
18981  // Change notification continues working in Idle mode for Port C
18982  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C);
18983 
18984  </code>
18985  Remarks:
18986  This function is only available in devices with PPS. For Non-PPS devices, use the
18987  PLIB_PORTS_ChangeNoticeInIdleEnable function.
18988 
18989  This feature may not be available on all devices. Please refer to the
18990  specific device data sheet to determine availability or use
18991  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
18992  whether this feature is available.
18993 */
18994 
18995 void
18997  PORTS_MODULE_ID index ,
18998  PORTS_CHANNEL channel ) ;
18999 // *****************************************************************************
19000 /* Function:
19001  void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable( PORTS_MODULE_ID index,
19002  PORTS_CHANNEL channel );
19003  Summary:
19004  Change Notification halts in Idle mode for selected channel.
19005  Description:
19006  This function makes sure that change notification feature halts in
19007  Idle mode for the selected channel.
19008  This function does not perform atomic register access.
19009  Precondition:
19010  None.
19011  Parameters:
19012  index - Identifier for the device instance to be configured
19013  channel - Port pin channel
19014  Returns:
19015  None.
19016  Example:
19017  <code>
19018 
19019  // Change notification halts in Idle mode for Port C
19020  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C);
19021 
19022  </code>
19023  Remarks:
19024  This function is only available in devices with PPS. For Non-PPS devices, use the
19025  PLIB_PORTS_ChangeNoticeInIdleDisable function.
19026 
19027  This feature may not be available on all devices. Please refer to the
19028  specific device data sheet to determine availability or use
19029  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
19030  whether this feature is available.
19031 */
19032 
19033 void
19035  PORTS_MODULE_ID index ,
19036  PORTS_CHANNEL channel ) ;
19037 // *****************************************************************************
19038 /* Function:
19039  bool PLIB_PORTS_ChangeNoticePerPortHasOccurred ( PORTS_MODULE_ID index,
19040  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
19041  Summary:
19042  checks the status of change on the pin
19043  Description:
19044  This function checks if the change has occurred on the given pin or not.
19045  This function does not perform atomic register access.
19046  Precondition:
19047  None.
19048  Parameters:
19049  index - Identifier for the device instance to be configured
19050  channel - Port pin channel
19051  bitPos - Position in the PORT pins
19052  Returns:
19053  None.
19054  Example:
19055  <code>
19056 
19057  if(PLIB_PORTS_ChangeNoticePerPortHasOccurred( PORTS_ID_0,
19058  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
19059  {
19060  //do something
19061  }
19062 
19063  </code>
19064  Remarks:
19065  This feature may not be available on all devices. Please refer to the
19066  specific device data sheet to determine availability or use
19067  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
19068  whether this feature is available.
19069 */
19070 
19071 bool
19073  PORTS_MODULE_ID index ,
19074  PORTS_CHANNEL channel ,
19075  PORTS_BIT_POS bitPos ) ;
19076 // *****************************************************************************
19077 /* Function:
19078  bool PLIB_PORTS_PinGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19079  PORTS_BIT_POS bitPos )
19080  Summary:
19081  Reads/Gets data from the selected digital pin.
19082  Description:
19083  This function reads/gets data from the selected digital PORT i/o pin.
19084  This function should be used to read the live data at the pin.
19085  This function does not perform atomic register access.
19086 
19087  Precondition:
19088  None.
19089  Parameters:
19090  index - Identifier for the device instance to be configured
19091  channel - Identifier for the Ports channel A, B, C, etc.
19092  bitPos - Possible values of PORTS_BIT_POS
19093  Returns:
19094  Port pin read data.
19095  Example:
19096  <code>
19097  // read port pin RC4
19098  bool bitStatus = PLIB_PORTS_PinGet(PORTS_ID_0, PORT_CHANNEL_C,
19099  PORTS_BIT_POS_4);
19100  </code>
19101  Remarks:
19102  For reading the Latched data, PLIB_PORTS_PinGetLatched function should be used.
19103 
19104  This feature may not be available on all devices. Please refer to the
19105  specific device data sheet to determine availability or use
19106  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19107  this feature is available.
19108 */
19109 
19110 bool
19112  PORTS_MODULE_ID index ,
19113  PORTS_CHANNEL channel ,
19114  PORTS_BIT_POS bitPos ) ;
19115 // *****************************************************************************
19116 /* Function:
19117  bool PLIB_PORTS_PinGetLatched( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19118  PORTS_BIT_POS bitPos )
19119  Summary:
19120  Reads/Gets data from the selected latch.
19121  Description:
19122  This function reads/gets data from the selected PORTx Data Latch, not from
19123  the port I/O pins.
19124  This function does not perform atomic register access.
19125 
19126  Precondition:
19127  None.
19128  Parameters:
19129  index - Identifier for the device instance to be configured
19130  channel - Identifier for the Ports channel A, B, C, etc.
19131  bitPos - Possible values of PORTS_BIT_POS
19132  Returns:
19133  Latch read data.
19134  Example:
19135  <code>
19136  // read latch RC4
19137  bool bitStatus = PLIB_PORTS_PinGetLatched(PORTS_ID_0, PORT_CHANNEL_C,
19138  PORTS_BIT_POS_4);
19139  </code>
19140  Remarks:
19141  For reading the Live data from the i/o pin, PLIB_PORTS_PinGet function
19142  should be used.
19143 
19144  This feature may not be available on all devices. Please refer to the
19145  specific device data sheet to determine availability or use
19146  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19147  this feature is available.
19148 */
19149 
19150 bool
19152  PORTS_MODULE_ID index ,
19153  PORTS_CHANNEL channel ,
19154  PORTS_BIT_POS bitPos ) ;
19155 // *****************************************************************************
19156 /* Function:
19157  void PLIB_PORTS_PinWrite( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19158  PORTS_BIT_POS bitPos,
19159  bool value )
19160  Summary:
19161  Writes the selected digital pin/latch.
19162  Description:
19163  This function writes to the selected digital pin/latch.
19164  This function does not perform atomic register access.
19165  Precondition:
19166  None.
19167  Parameters:
19168  index - Identifier for the device instance to be configured
19169  channel - Identifier for the Ports channel A, B, C, etc.
19170  bitPos - Possible values of PORTS_BIT_POS
19171  value - Value to be written to the specific pin/latch
19172  true - sets the bit, false - clears the bit
19173  Returns:
19174  None.
19175  Example:
19176  <code>
19177 
19178  // write 'one' in port RC4
19179  PLIB_PORTS_PinWrite(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4, 1);
19180 
19181  </code>
19182  Remarks:
19183  This feature may not be available on all devices. Please refer to the
19184  specific device data sheet to determine availability or use
19185  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19186  this feature is available.
19187 */
19188 
19189 void
19191  PORTS_MODULE_ID index ,
19192  PORTS_CHANNEL channel ,
19193  PORTS_BIT_POS bitPos ,
19194  bool value ) ;
19195 // *****************************************************************************
19196 /* Function:
19197  void PLIB_PORTS_PinSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19198  PORTS_BIT_POS bitPos )
19199  Summary:
19200  Sets the selected digital pin/latch.
19201  Description:
19202  This function sets the selected digital pin/latch.
19203  This function does not perform atomic register access.
19204  Precondition:
19205  None.
19206  Parameters:
19207  index - Identifier for the device instance to be configured
19208  channel - Identifier for the Ports channel A, B, C, etc.
19209  bitPos - Possible values of PORTS_BIT_POS
19210  Returns:
19211  None.
19212  Example:
19213  <code>
19214 
19215  // Sets port pin RC4
19216  PLIB_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19217 
19218  </code>
19219  Remarks:
19220  This feature may not be available on all devices. Please refer to the
19221  specific device data sheet to determine availability or use
19222  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19223  this feature is available.
19224 */
19225 
19226 void
19228  PORTS_MODULE_ID index ,
19229  PORTS_CHANNEL channel ,
19230  PORTS_BIT_POS bitPos ) ;
19231 // *****************************************************************************
19232 /* Function:
19233  void PLIB_PORTS_PinClear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19234  PORTS_BIT_POS bitPos )
19235  Summary:
19236  Clears the selected digital pin/latch.
19237  Description:
19238  This function clears the selected digital pin/latch.
19239  This function does not perform atomic register access.
19240  Precondition:
19241  None.
19242  Parameters:
19243  index - Identifier for the device instance to be configured
19244  channel - Identifier for the Ports channel A, B, C, etc.
19245  bitPos - Possible values of PORTS_BIT_POS
19246  Returns:
19247  None.
19248  Example:
19249  <code>
19250 
19251  // Clears port pin RC4
19252  PLIB_PORTS_PinClear(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19253 
19254  </code>
19255  Remarks:
19256  This feature may not be available on all devices. Please refer to the
19257  specific device data sheet to determine availability or use
19258  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19259  this feature is available.
19260 */
19261 
19262 void
19264  PORTS_MODULE_ID index ,
19265  PORTS_CHANNEL channel ,
19266  PORTS_BIT_POS bitPos ) ;
19267 // *****************************************************************************
19268 /* Function:
19269  void PLIB_PORTS_PinToggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19270  PORTS_BIT_POS bitPos )
19271  Summary:
19272  Toggles the selected digital pin/latch.
19273  Description:
19274  This function toggles the selected digital pin/latch.
19275  This function does not perform atomic register access.
19276  Precondition:
19277  None.
19278  Parameters:
19279  index - Identifier for the device instance to be configured
19280  channel - Identifier for the Ports channel A, B, C, etc.
19281  bitPos - Possible values of PORTS_BIT_POS
19282  Returns:
19283  None.
19284  Example:
19285  <code>
19286 
19287  // Toggles port pin RC4
19288  PLIB_PORTS_PinToggle(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19289 
19290  </code>
19291  Remarks:
19292  This feature may not be available on all devices. Please refer to the
19293  specific device data sheet to determine availability or use
19294  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19295  this feature is available.
19296 */
19297 
19298 void
19300  PORTS_MODULE_ID index ,
19301  PORTS_CHANNEL channel ,
19302  PORTS_BIT_POS bitPos ) ;
19303 // *****************************************************************************
19304 /* Function:
19305  void PLIB_PORTS_PinDirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19306  PORTS_BIT_POS bitPos )
19307  Summary:
19308  Makes the selected pin direction input
19309  Description:
19310  This function makes the selected pin direction as input
19311  This function does not perform atomic register access.
19312  Precondition:
19313  None.
19314  Parameters:
19315  index - Identifier for the device instance to be configured
19316  channel - Identifier for the Ports channel A, B, C, etc.
19317  bitPos - Possible values of PORTS_BIT_POS direction that has to
19318  be made input
19319  Returns:
19320  None.
19321  Example:
19322  <code>
19323 
19324  // make pin RC4 as input
19325  PLIB_PORTS_PinDirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19326 
19327  </code>
19328  Remarks:
19329  This feature may not be available on all devices. Please refer to the
19330  specific device data sheet to determine availability or use
19331  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19332  this feature is available.
19333 */
19334 
19335 void
19337  PORTS_MODULE_ID index ,
19338  PORTS_CHANNEL channel ,
19339  PORTS_BIT_POS bitPos ) ;
19340 // *****************************************************************************
19341 /* Function:
19342  void PLIB_PORTS_PinDirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19343  PORTS_BIT_POS bitPos )
19344  Summary:
19345  Makes the selected pin direction output
19346  Description:
19347  This function makes the selected pin direction as output
19348  This function does not perform atomic register access.
19349  Precondition:
19350  None.
19351  Parameters:
19352  index - Identifier for the device instance to be configured
19353  channel - Identifier for the Ports channel A, B, C, etc.
19354  bitPos - Possible values of PORTS_BIT_POS direction that has to
19355  be made output
19356  Returns:
19357  None.
19358  Example:
19359  <code>
19360 
19361  // make pin RC4 as output
19362  PLIB_PORTS_PinDirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19363 
19364  </code>
19365  Remarks:
19366  This feature may not be available on all devices. Please refer to the
19367  specific device data sheet to determine availability or use
19368  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19369  this feature is available.
19370 */
19371 
19372 void
19374  PORTS_MODULE_ID index ,
19375  PORTS_CHANNEL channel ,
19376  PORTS_BIT_POS bitPos ) ;
19377 // *****************************************************************************
19378 /* Function:
19379  void PLIB_PORTS_PinOpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19380  PORTS_BIT_POS bitPos )
19381  Summary:
19382  Enables the open drain functionality for the selected pin.
19383  Description:
19384  This function enables the open drain functionality for the selected pin.
19385  This function does not perform atomic register access.
19386  Precondition:
19387  None.
19388  Parameters:
19389  index - Identifier for the device instance to be configured
19390  channel - Identifier for the Ports channel A, B, C, etc.
19391  bitPos - Possible values of PORTS_BIT_POS
19392  Returns:
19393  None.
19394  Example:
19395  <code>
19396 
19397  // Enable open drain for pin RC4
19398  PLIB_PORTS_PinOpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19399 
19400  </code>
19401  Remarks:
19402  This feature may not be available on all devices. Please refer to the
19403  specific device data sheet to determine availability or use
19404  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19405  this feature is available.
19406 */
19407 
19408 void
19410  PORTS_MODULE_ID index ,
19411  PORTS_CHANNEL channel ,
19412  PORTS_BIT_POS bitPos ) ;
19413 // *****************************************************************************
19414 /* Function:
19415  void PLIB_PORTS_PinOpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19416  PORTS_BIT_POS bitPos )
19417  Summary:
19418  Disables the open drain functionality for the selected pin.
19419  Description:
19420  This function disables the open drain functionality for the selected pin.
19421  This function does not perform atomic register access.
19422  Precondition:
19423  None.
19424  Parameters:
19425  index - Identifier for the device instance to be configured
19426  channel - Identifier for the Ports channel A, B, C, etc.
19427  bitPos - One of the possible values of PORTS_BIT_POS.
19428  Returns:
19429  None.
19430  Example:
19431  <code>
19432 
19433  // Disable open drain for pin RC4
19434  PLIB_PORTS_PinOpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19435 
19436  </code>
19437  Remarks:
19438  This feature may not be available on all devices. Please refer to the
19439  specific device data sheet to determine availability or use
19440  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19441  this feature is available.
19442 */
19443 
19444 void
19446  PORTS_MODULE_ID index ,
19447  PORTS_CHANNEL channel ,
19448  PORTS_BIT_POS bitPos ) ;
19449 // *****************************************************************************
19450 /* Function:
19451  PORTS_DATA_TYPE PLIB_PORTS_ReadLatched
19452  (
19453  PORTS_MODULE_ID index,
19454  PORTS_CHANNEL channel
19455  )
19456  Summary:
19457  Reads and returns data from the selected Latch.
19458  Description:
19459  This function reads and returns the data from the selected Latch.
19460  This function does not perform atomic register access.
19461 
19462  Precondition:
19463  None.
19464  Parameters:
19465  index - Identifier for the device instance to be configured
19466  channel - Identifier for the Ports channel A, B, C, etc.
19467  Returns:
19468  Latch read data.
19469  Example:
19470  <code>
19471  // Read latch C
19472  PORTS_DATA_TYPE bitStatus = PLIB_PORTS_ReadLatched(PORTS_ID_0, PORT_CHANNEL_C);
19473 
19474  </code>
19475  Remarks:
19476  For reading the Live data, PLIB_PORTS_Read function should be used.
19477 
19478  This feature may not be available on all devices. Please refer to the
19479  specific device data sheet to determine availability or use
19480  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19481  this feature is available.
19482 */
19483 
19486  PORTS_MODULE_ID index ,
19487  PORTS_CHANNEL channel ) ;
19488 // *****************************************************************************
19489 /* Function:
19490  PORTS_DATA_TYPE PLIB_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
19491  Summary:
19492  Reads the selected digital port.
19493  Description:
19494  This function reads from the selected digital port.
19495  This function does not perform atomic register access.
19496  Precondition:
19497  None.
19498  Parameters:
19499  index - Identifier for the device instance to be configured
19500  channel - Identifier for the Ports channel A, B, C, etc.
19501  Returns:
19502  data on a port with width PORTS_DATA_TYPE
19503  Example:
19504  <code>
19505 
19506  // Read PORT C
19507  PORTS_DATA_TYPE readData = PLIB_PORTS_Read(PORTS_ID_0, PORT_CHANNEL_C);
19508 
19509  </code>
19510  Remarks:
19511  For reading the Latched data, PLIB_PORTS_ReadLatched function should be used.
19512 
19513  This feature may not be available on all devices. Please refer to the
19514  specific device data sheet to determine availability or use
19515  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19516  this feature is available.
19517 */
19518 
19520  PLIB_PORTS_Read (
19521  PORTS_MODULE_ID index ,
19522  PORTS_CHANNEL channel ) ;
19523 // *****************************************************************************
19524 /* Function:
19525  void PLIB_PORTS_Write( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19526  PORTS_DATA_TYPE value )
19527  Summary:
19528  Writes the selected digital port/latch.
19529  Description:
19530  This function writes to the selected digital port/latch.
19531  This function does not perform atomic register access.
19532  Precondition:
19533  None.
19534  Parameters:
19535  index - Identifier for the device instance to be configured
19536  channel - Identifier for the Ports channel A, B, C, etc.
19537  value - Value to be written into a port of width PORTS_DATA_TYPE
19538  Returns:
19539  None.
19540  Example:
19541  <code>
19542 
19543  // Write 0x12 into PORT C
19544  PLIB_PORTS_Write(PORTS_ID_0, PORT_CHANNEL_C, 0x12);
19545 
19546  </code>
19547  Remarks:
19548  This feature may not be available on all devices. Please refer to the
19549  specific device data sheet to determine availability or use
19550  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19551  this feature is available.
19552 */
19553 
19554 void
19556  PORTS_MODULE_ID index ,
19557  PORTS_CHANNEL channel ,
19558  PORTS_DATA_TYPE value ) ;
19559 // *****************************************************************************
19560 /* Function:
19561  void PLIB_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19562  PORTS_DATA_TYPE value,
19563  PORTS_DATA_MASK mask )
19564  Summary:
19565  Sets the selected bits of the port.
19566  Description:
19567  This function performs an 'AND' operation on the value and mask parameters,
19568  and then sets the bits in the port channel that were set by the result of the
19569  'AND' operation.
19570  This function does not perform atomic register access.
19571  Precondition:
19572  None.
19573  Parameters:
19574  index - Identifier for the device instance to be configured
19575  channel - Identifier for the Ports channel A, B, C, etc.
19576  value - Consists of information about which port bit has to be
19577  set and which not
19578  mask - Identifies the bits which could be intended for setting
19579  Returns:
19580  None.
19581  Example:
19582  <code>
19583 
19584  // MY_VALUE - 0x1234
19585  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
19586 
19587  // Set the PORT C bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
19588  PLIB_PORTS_Set(MY_PORTS_INSTANCE, PORT_CHANNEL_C, MY_VALUE, myMask);
19589 
19590  </code>
19591  Remarks:
19592  This feature may not be available on all devices. Please refer to the
19593  specific device data sheet to determine availability or use
19594  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19595  this feature is available.
19596 */
19597 
19598 void
19599  PLIB_PORTS_Set (
19600  PORTS_MODULE_ID index ,
19601  PORTS_CHANNEL channel ,
19602  PORTS_DATA_TYPE value ,
19603  PORTS_DATA_MASK mask ) ;
19604 // *****************************************************************************
19605 /* Function:
19606  void PLIB_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19607  PORTS_DATA_MASK toggleMask )
19608  Summary:
19609  Toggles the selected digital port/latch.
19610  Description:
19611  This function toggles the selected digital port/latch.
19612  This function does not perform atomic register access.
19613  Precondition:
19614  None.
19615  Parameters:
19616  index - Identifier for the device instance to be configured
19617  channel - Identifier for the Ports channel A, B, C, etc.
19618  toggleMask - Identifies the bits to be toggled
19619  Returns:
19620  None.
19621  Example:
19622  <code>
19623 
19624  // Toggles the three least significant Port C bits
19625  PLIB_PORTS_Toggle(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19626 
19627  </code>
19628  Remarks:
19629  This feature may not be available on all devices. Please refer to the
19630  specific device data sheet to determine availability or use
19631  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19632  this feature is available.
19633 */
19634 
19635 void
19637  PORTS_MODULE_ID index ,
19638  PORTS_CHANNEL channel ,
19639  PORTS_DATA_MASK toggleMask ) ;
19640 // *****************************************************************************
19641 /* Function:
19642  void PLIB_PORTS_Clear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19643  PORTS_DATA_MASK clearMask )
19644  Summary:
19645  Clears the selected digital port/latch bits.
19646  Description:
19647  This function clears the selected digital port/latch bits.
19648  This function does not perform atomic register access.
19649  Precondition:
19650  None.
19651  Parameters:
19652  index - Identifier for the device instance to be configured
19653  channel - Identifier for the Ports channel A, B, C, etc.
19654  clearMask - Identifies the bits to be cleared
19655  Returns:
19656  None.
19657  Example:
19658  <code>
19659 
19660  // Clears the three least significant Port C bits
19661  PLIB_PORTS_Clear(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19662 
19663  </code>
19664  Remarks:
19665  This feature may not be available on all devices. Please refer to the
19666  specific device data sheet to determine availability or use
19667  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19668  this feature is available.
19669 */
19670 
19671 void
19673  PORTS_MODULE_ID index ,
19674  PORTS_CHANNEL channel ,
19675  PORTS_DATA_MASK clearMask ) ;
19676 // *****************************************************************************
19677 /* Function:
19678  void PLIB_PORTS_DirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19679  PORTS_DATA_MASK mask )
19680  Summary:
19681  Makes the selected pins direction input.
19682  Description:
19683  This function makes the selected pins direction input.
19684  This function does not perform atomic register access.
19685 
19686  Precondition:
19687  None.
19688  Parameters:
19689  index - Identifier for the device instance to be configured
19690  channel - Identifier for the Ports channel A, B, C, etc.
19691  mask - Identifies the pins direction that has to be made input
19692  Returns:
19693  None.
19694  Example:
19695  <code>
19696 
19697  // Make RC0, RC1 and RC2 pins as Input
19698  PLIB_PORTS_DirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19699 
19700  </code>
19701  Remarks:
19702  This feature may not be available on all devices. Please refer to the
19703  specific device data sheet to determine availability or use
19704  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19705  this feature is available.
19706 */
19707 
19708 void
19710  PORTS_MODULE_ID index ,
19711  PORTS_CHANNEL channel ,
19712  PORTS_DATA_MASK mask ) ;
19713 // *****************************************************************************
19714 /* Function:
19715  void PLIB_PORTS_DirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19716  PORTS_DATA_MASK mask )
19717  Summary:
19718  Makes the selected pins direction output.
19719  Description:
19720  This function makes the selected pins direction output.
19721  This function does not perform atomic register access.
19722  Precondition:
19723  None.
19724  Parameters:
19725  index - Identifier for the device instance to be configured
19726  channel - Identifier for the Ports channel A, B, C, etc.
19727  mask - Identifies the pins direction that has to be made output
19728  Returns:
19729  None.
19730  Example:
19731  <code>
19732 
19733  // Make RC0, RC1 and RC2 pins as Output
19734  PLIB_PORTS_DirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19735 
19736  </code>
19737  Remarks:
19738  This feature may not be available on all devices. Please refer to the
19739  specific device data sheet to determine availability or use
19740  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19741  this feature is available.
19742 */
19743 
19744 void
19746  PORTS_MODULE_ID index ,
19747  PORTS_CHANNEL channel ,
19748  PORTS_DATA_MASK mask ) ;
19749 // *****************************************************************************
19750 /* Function:
19751  PORTS_DATA_MASK PLIB_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
19752  Summary:
19753  Reads the direction of the selected digital port.
19754  Description:
19755  This function reads the direction of the selected digital port.
19756  This function does not perform atomic register access.
19757  Precondition:
19758  None.
19759  Parameters:
19760  index - Identifier for the device instance to be configured
19761  channel - Identifier for the Ports channel A, B, C, etc.
19762  Returns:
19763  Direction of the selected port of type PORTS_DATA_MASK
19764  Example:
19765  <code>
19766 
19767  // Reads the direction of Port C pins
19768  PORTS_DATA_MASK readDir = PLIB_PORTS_DirectionGet(PORTS_ID_0, PORT_CHANNEL_C);
19769 
19770  </code>
19771  Remarks:
19772  This feature may not be available on all devices. Please refer to the
19773  specific device data sheet to determine availability or use
19774  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19775  this feature is available.
19776 */
19777 
19780  PORTS_MODULE_ID index ,
19781  PORTS_CHANNEL channel ) ;
19782 // *****************************************************************************
19783 /* Function:
19784  void PLIB_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19785  PORTS_DATA_MASK mask )
19786  Summary:
19787  Enables the open drain functionality for the selected port pins.
19788  Description:
19789  This function enables the open drain functionality for the selected port pins.
19790  This function does not perform atomic register access.
19791  Precondition:
19792  None.
19793  Parameters:
19794  index - Identifier for the device instance to be configured
19795  channel - Identifier for the Ports channel A, B, C, etc.
19796  mask - Identifies the pins for the open drain to be enabled
19797  Returns:
19798  None.
19799  Example:
19800  <code>
19801 
19802  // Enable Open Drain for RC0, RC1 and RC2 pins
19803  PLIB_PORTS_OpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19804 
19805  </code>
19806  Remarks:
19807  This feature may not be available on all devices. Please refer to the
19808  specific device data sheet to determine availability or use
19809  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19810  this feature is available.
19811 */
19812 
19813 void
19815  PORTS_MODULE_ID index ,
19816  PORTS_CHANNEL channel ,
19817  PORTS_DATA_MASK mask ) ;
19818 // *****************************************************************************
19819 /* Function:
19820  void PLIB_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19821  PORTS_DATA_MASK mask )
19822  Summary:
19823  Disables the open drain functionality for the selected port.
19824  Description:
19825  This function disables the open drain functionality for the selected port.
19826  This function does not perform atomic register access.
19827 
19828  Precondition:
19829  None.
19830  Parameters:
19831  index - Identifier for the device instance to be configured
19832  channel - Identifier for the Ports channel A, B, C, etc.
19833  mask - Identifies the pins for the open drain to be disabled
19834  Returns:
19835  None.
19836  Example:
19837  <code>
19838 
19839  // Disable Open Drain for RC0, RC1 and RC2 pins
19840  PLIB_PORTS_OpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19841 
19842  </code>
19843  Remarks:
19844  This feature may not be available on all devices. Please refer to the
19845  specific device data sheet to determine availability or use
19846  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19847  this feature is available.
19848 */
19849 
19850 void
19852  PORTS_MODULE_ID index ,
19853  PORTS_CHANNEL channel ,
19854  PORTS_DATA_MASK mask ) ;
19855 // *****************************************************************************
19856 /* Function:
19857  void PLIB_PORTS_ChannelModeSelect
19858  (
19859  PORTS_MODULE_ID index,
19860  PORTS_CHANNEL channel,
19861  PORTS_DATA_MASK modeMask,
19862  PORTS_PIN_MODE mode
19863  );
19864  Summary:
19865  Enables the selected channel pins as analog or digital.
19866  Description:
19867  This function enables the selected channel pins as analog or digital.
19868  This function does not perform atomic register access.
19869  Precondition:
19870  None.
19871  Parameters:
19872  index - Identifier for the device instance to be configured
19873  channel - Port pin channel
19874  modeMask - Identifies the pins whose mode has to be modified.
19875  Modes of the pins whose corresponding bit is '1' get
19876  modified, mode of the other pins remains the same.
19877  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
19878  Returns:
19879  None.
19880  Example:
19881  <code>
19882 
19883  // Make pins RC5, RC8 and RC13 Analog
19884  PLIB_PORTS_ChannelModeSelect(PORTS_ID_0, PORT_CHANNEL_C, 0x2120, PORTS_PIN_MODE_ANALOG);
19885 
19886  </code>
19887  Remarks:
19888  This function is only available in devices with PPS. For Non-PPS devices, use the
19889  PLIB_PORTS_AnPinsModeSelect function.
19890 
19891  This feature may not be available on all devices. Please refer to the
19892  specific device data sheet to determine availability or use
19893  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
19894  this feature is available.
19895 */
19896 
19897 void
19899  PORTS_MODULE_ID index ,
19900  PORTS_CHANNEL channel ,
19901  PORTS_DATA_MASK modeMask ,
19902  PORTS_PIN_MODE mode ) ;
19903 // *****************************************************************************
19904 /* Function:
19905  void PLIB_PORTS_ChannelChangeNoticePullUpEnable
19906  (
19907  PORTS_MODULE_ID index,
19908  PORTS_CHANNEL channel,
19909  PORTS_DATA_MASK mask
19910  );
19911  Summary:
19912  Enables Change Notice pull-up for the selected channel pins.
19913  Description:
19914  This function enables the Change Notice pull-up for the selected
19915  channel pins.
19916  This function does not perform atomic register access.
19917  Precondition:
19918  None.
19919  Parameters:
19920  index - Identifier for the device instance to be configured
19921  channel - Port pin channel
19922  mask - Identifies the pins of the pull-up to be enabled
19923  Returns:
19924  None.
19925  Example:
19926  <code>
19927 
19928  // Enable pull-up for RC5, RC8 and RC13 pins
19929  PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_ID_0, PORT_CHANNEL_C,
19930  0x2120);
19931  </code>
19932  Remarks:
19933  This function is only available in devices with PPS. For Non-PPS devices, use the
19934  PLIB_PORTS_CnPinsPullUpEnable function.
19935 
19936  This feature may not be available on all devices. Please refer to the
19937  specific device data sheet to determine availability or use
19938  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19939  determine whether this feature is available.
19940 */
19941 
19942 void
19944  PORTS_MODULE_ID index ,
19945  PORTS_CHANNEL channel ,
19946  PORTS_DATA_MASK mask ) ;
19947 // *****************************************************************************
19948 /* Function:
19949  void PLIB_PORTS_ChannelChangeNoticePullUpDisable
19950  (
19951  PORTS_MODULE_ID index,
19952  PORTS_CHANNEL channel,
19953  PORTS_DATA_MASK mask
19954  );
19955  Summary:
19956  Disables Change Notice pull-up for the selected channel pins.
19957  Description:
19958  This function Disables the Change Notice pull-up for the selected
19959  channel pins.
19960  PLIB_PORTS_ChannelChangeNoticePullUpDisable
19961  Precondition:
19962  None.
19963  Parameters:
19964  index - Identifier for the device instance to be configured
19965  channel - Port pin channel
19966  mask - Identifies the pins of the pull-up to be disabled
19967  Returns:
19968  None.
19969  Example:
19970  <code>
19971 
19972  // Disable pull-up for RC5, RC8 and RC13 pins
19973  PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_ID_0, PORT_CHANNEL_C,
19974  0x2120);
19975  </code>
19976  Remarks:
19977  This function is only available in devices with PPS. For Non-PPS devices, use the
19978  PLIB_PORTS_CnPinsPullUpDisable function.
19979 
19980  This feature may not be available on all devices. Please refer to the
19981  specific device data sheet to determine availability or use
19982  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19983  determine whether this feature is available.
19984 */
19985 
19986 void
19988  PORTS_MODULE_ID index ,
19989  PORTS_CHANNEL channel ,
19990  PORTS_DATA_MASK mask ) ;
19991 // *****************************************************************************
19992 /* Function:
19993  void PLIB_PORTS_ChannelChangeNoticePullDownEnable
19994  (
19995  PORTS_MODULE_ID index,
19996  PORTS_CHANNEL channel,
19997  PORTS_DATA_MASK mask
19998  );
19999  Summary:
20000  Enables Change Notice pull-down for the selected channel pins.
20001  Description:
20002  This function enables the Change Notice pull-down for the selected
20003  channel pins.
20004  This function does not perform atomic register access.
20005  Precondition:
20006  None.
20007  Parameters:
20008  index - Identifier for the device instance to be configured
20009  channel - Port pin channel
20010  mask - Identifies the pins for the pull-down to be enabled
20011  Returns:
20012  None.
20013  Example:
20014  <code>
20015 
20016  // Enable pull-down for RC5, RC8 and RC13 pins
20017  PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_ID_0, PORT_CHANNEL_C,
20018  0x2120);
20019  </code>
20020  Remarks:
20021  This feature may not be available on all devices. Please refer to the
20022  specific device data sheet to determine availability or use
20023  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20024  determine whether this feature is available.
20025 */
20026 
20027 void
20029  PORTS_MODULE_ID index ,
20030  PORTS_CHANNEL channel ,
20031  PORTS_DATA_MASK mask ) ;
20032 // *****************************************************************************
20033 /* Function:
20034  void PLIB_PORTS_ChannelChangeNoticePullDownDisable
20035  (
20036  PORTS_MODULE_ID index,
20037  PORTS_CHANNEL channel,
20038  PORTS_DATA_MASK mask
20039  );
20040  Summary:
20041  Disables Change Notice pull-down for the selected channel pins.
20042  Description:
20043  This function Disables the Change Notice pull-down for the selected
20044  channel pins.
20045  This function does not perform atomic register access.
20046  Precondition:
20047  None.
20048  Parameters:
20049  index - Identifier for the device instance to be configured
20050  channel - Port pin channel
20051  mask - Identifies the pins for the pull-down to be disabled
20052  Returns:
20053  None.
20054  Example:
20055  <code>
20056 
20057  // Disable pull-down for RC5, RC8 and RC13 pins
20058  PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_ID_0, PORT_CHANNEL_C,
20059  0x2120);
20060  </code>
20061  Remarks:
20062  This feature may not be available on all devices. Please refer to the
20063  specific device data sheet to determine availability or use
20064  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20065  determine whether this feature is available.
20066 */
20067 
20068 void
20070  PORTS_MODULE_ID index ,
20071  PORTS_CHANNEL channel ,
20072  PORTS_DATA_MASK mask ) ;
20073 // *****************************************************************************
20074 /* Function:
20075  void PLIB_PORTS_ChannelChangeNoticeEnable
20076  (
20077  PORTS_MODULE_ID index,
20078  PORTS_CHANNEL channel,
20079  PORTS_DATA_MASK mask
20080  );
20081  Summary:
20082  Enables CN interrupt for the selected pins of a channel.
20083  Description:
20084  This function enables Change Notice interrupt for the selected port
20085  pins of a channel.
20086  This function does not perform atomic register access.
20087  Precondition:
20088  None.
20089  Parameters:
20090  index - Identifier for the device instance to be configured
20091  channel - Port pin channel
20092  mask - Identifies the pins for which change notification is
20093  to be enabled
20094  Returns:
20095  None.
20096  Example:
20097  <code>
20098 
20099  // Enable CN interrupt for RC5, RC8 and RC13 pins
20100  PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20101 
20102  </code>
20103  Remarks:
20104  This function is only available in devices with PPS. For Non-PPS devices, use the
20105  PLIB_PORTS_CnPinsEnable function.
20106 
20107  This feature may not be available on all devices. Please refer to the
20108  specific device data sheet to determine availability or use
20109  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20110  determine whether this feature is available.
20111 */
20112 
20113 void
20115  PORTS_MODULE_ID index ,
20116  PORTS_CHANNEL channel ,
20117  PORTS_DATA_MASK mask ) ;
20118 // *****************************************************************************
20119 /* Function:
20120  void PLIB_PORTS_ChannelChangeNoticeDisable
20121  (
20122  PORTS_MODULE_ID index,
20123  PORTS_CHANNEL channel,
20124  PORTS_DATA_MASK mask
20125  );
20126  Summary:
20127  Disables CN interrupt for the selected pins of a channel.
20128  Description:
20129  This function Disables Change Notice interrupt for the selected port
20130  pins of a channel.
20131  This function does not perform atomic register access.
20132  Precondition:
20133  None.
20134  Parameters:
20135  index - Identifier for the device instance to be configured
20136  channel - Port pin channel
20137  mask - Identifies the pins for which change notification is
20138  to be disabled
20139  Returns:
20140  None.
20141  Example:
20142  <code>
20143 
20144  // Disable CN interrupt for RC5, RC8 and RC13 pins
20145  PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20146 
20147  </code>
20148  Remarks:
20149  This function is only available in devices with PPS. For Non-PPS devices, use the
20150  PLIB_PORTS_CnPinsDisable function.
20151 
20152  This feature may not be available on all devices. Please refer to the
20153  specific device data sheet to determine availability or use
20154  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20155  determine whether this feature is available.
20156 */
20157 
20158 void
20160  PORTS_MODULE_ID index ,
20161  PORTS_CHANNEL channel ,
20162  PORTS_DATA_MASK mask ) ;
20163 // *****************************************************************************
20164 /* Function:
20165  void PLIB_PORTS_AnPinsModeSelect
20166  (
20167  PORTS_MODULE_ID index,
20168  PORTS_AN_PIN anPins,
20169  PORTS_PIN_MODE mode
20170  );
20171  Summary:
20172  Enables the selected AN pins as analog or digital.
20173  Description:
20174  This function enables the selected AN pins as analog or digital.
20175  This function does not perform atomic register access.
20176  Precondition:
20177  None.
20178  Parameters:
20179  index - Identifier for the device instance to be configured
20180  anPins - AN pins whose mode is to be changed. Multiple AN pins
20181  can be ORed.
20182  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
20183  Returns:
20184  None.
20185  Example:
20186  <code>
20187 
20188  // Make pins AN5, AN8 and AN13 Analog
20189  PLIB_PORTS_AnPinsModeSelect(PORTS_ID_0, PORTS_AN_PIN_5 |
20190  PORTS_AN_PIN_8 |
20191  PORTS_AN_PIN_13,
20192  PORTS_PIN_MODE_ANALOG);
20193 
20194  </code>
20195  Remarks:
20196  This function is only available in devices without PPS feature. For PPS
20197  devices, use the PLIB_PORTS_ChannelModeSelect function.
20198 
20199  This feature may not be available on all devices. Please refer to the
20200  specific device data sheet to determine availability or use
20201  PLIB_PORTS_ExistsAnPinsMode in your application to determine whether
20202  this feature is available.
20203 */
20204 
20205 void
20207  PORTS_MODULE_ID index ,
20208  PORTS_AN_PIN anPins ,
20209  PORTS_PIN_MODE mode ) ;
20210 // *****************************************************************************
20211 /* Function:
20212  void PLIB_PORTS_CnPinsPullUpEnable
20213  (
20214  PORTS_MODULE_ID index,
20215  PORTS_CN_PIN cnPins
20216  );
20217  Summary:
20218  Enables Change Notice pull-up for the selected channel pins.
20219  Description:
20220  This function enables the Change Notice pull-up for the selected
20221  channel pins.
20222  This function performs atomic register access.
20223  Precondition:
20224  None.
20225  Parameters:
20226  index - Identifier for the device instance to be configured
20227  cnPins - CN pins whose pull-up is to be enabled. Multiple CN pins
20228  can be ORed.
20229  Returns:
20230  None.
20231  Example:
20232  <code>
20233 
20234  // Enable pull-up for CN5, CN8 and CN13 pins
20235  PLIB_PORTS_CnPinsPullUpEnable(PORTS_ID_0, CHANGE_NOTICE_PIN_5 |
20236  CHANGE_NOTICE_PIN_8 |
20237  CHANGE_NOTICE_PIN_13);
20238 
20239  </code>
20240  Remarks:
20241  This function is only available in devices without PPS feature. For PPS
20242  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpEnable function.
20243 
20244  This feature may not be available on all devices. Please refer to the
20245  specific device data sheet to determine availability or use
20246  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20247  determine whether this feature is available.
20248 */
20249 
20250 void
20252  PORTS_MODULE_ID index ,
20253  PORTS_CN_PIN cnPins ) ;
20254 // *****************************************************************************
20255 /* Function:
20256  void PLIB_PORTS_CnPinsPullUpDisable
20257  (
20258  PORTS_MODULE_ID index,
20259  PORTS_CN_PIN cnPins
20260  );
20261  Summary:
20262  Disables Change Notice pull-up for the selected channel pins.
20263  Description:
20264  This function Disables the Change Notice pull-up for the selected
20265  channel pins.
20266  This function performs atomic register access.
20267  Precondition:
20268  None.
20269  Parameters:
20270  index - Identifier for the device instance to be configured
20271  cnPins - CN pins whose pull-up is to be disabled. Multiple CN pins
20272  can be ORed.
20273  Returns:
20274  None.
20275  Example:
20276  <code>
20277 
20278  // Disable pull-up for CN5, CN8 and CN13 pins
20279  PLIB_PORTS_CnPinsPullUpDisable(PORTS_ID_0,
20280  CHANGE_NOTICE_PIN_5 |
20281  CHANGE_NOTICE_PIN_8 |
20282  CHANGE_NOTICE_PIN_13);
20283 
20284  </code>
20285  Remarks:
20286  This function is only available in devices without PPS feature. For PPS
20287  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpDisable function.
20288 
20289  This feature may not be available on all devices. Please refer to the
20290  specific device data sheet to determine availability or use
20291  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20292  determine whether this feature is available.
20293 */
20294 
20295 void
20297  PORTS_MODULE_ID index ,
20298  PORTS_CN_PIN cnPins ) ;
20299 // *****************************************************************************
20300 /* Function:
20301  void PLIB_PORTS_CnPinsEnable
20302  (
20303  PORTS_MODULE_ID index,
20304  PORTS_CN_PIN cnPins
20305  );
20306  Summary:
20307  Enables CN interrupt for the selected pins of a channel.
20308  Description:
20309  This function enables Change Notice interrupt for the selected port
20310  pins of a channel.
20311  This function performs atomic register access.
20312  Precondition:
20313  None.
20314  Parameters:
20315  index - Identifier for the device instance to be configured
20316  cnPins - CN pins to be enabled. Multiple CN pins can be ORed.
20317  Returns:
20318  None.
20319  Example:
20320  <code>
20321 
20322  // Enable CN interrupt for CN5, CN8 and CN13 pins
20323  PLIB_PORTS_CnPinsEnable(PORTS_ID_0,
20324  CHANGE_NOTICE_PIN_5 |
20325  CHANGE_NOTICE_PIN_8 |
20326  CHANGE_NOTICE_PIN_13);
20327 
20328  </code>
20329  Remarks:
20330  This function is only available in devices without PPS feature. For PPS
20331  devices, use the PLIB_PORTS_ChannelChangeNoticeEnable function.
20332 
20333  This feature may not be available on all devices. Please refer to the
20334  specific device data sheet to determine availability or use
20335  PLIB_PORTS_ExistsPinChangeNotice in your application to
20336  determine whether this feature is available.
20337 */
20338 
20339 void
20341  PORTS_MODULE_ID index ,
20342  PORTS_CN_PIN cnPins ) ;
20343 // *****************************************************************************
20344 /* Function:
20345  void PLIB_PORTS_CnPinsDisable
20346  (
20347  PORTS_MODULE_ID index,
20348  PORTS_CN_PIN cnPins
20349  );
20350  Summary:
20351  Disables CN interrupt for the selected pins of a channel.
20352  Description:
20353  This function Disables Change Notice interrupt for the selected port
20354  pins of a channel.
20355  This function performs atomic register access.
20356  Precondition:
20357  None.
20358  Parameters:
20359  index - Identifier for the device instance to be configured
20360  cnPins - CN pins to be disabled. Multiple CN pins can be ORed.
20361  Returns:
20362  None.
20363  Example:
20364  <code>
20365 
20366  // Disable CN interrupt for CN5, CN8 and CN13 pins
20367  PLIB_PORTS_CnPinsDisable(PORTS_ID_0,
20368  CHANGE_NOTICE_PIN_5 |
20369  CHANGE_NOTICE_PIN_8 |
20370  CHANGE_NOTICE_PIN_13);
20371 
20372  </code>
20373  Remarks:
20374  This function is only available in devices without PPS feature. For PPS
20375  devices, use the PLIB_PORTS_ChannelChangeNoticeDisable function.
20376 
20377  This feature may not be available on all devices. Please refer to the
20378  specific device data sheet to determine availability or use
20379  PLIB_PORTS_ExistsPinChangeNotice in your application to
20380  determine whether this feature is available.
20381 */
20382 
20383 void
20385  PORTS_MODULE_ID index ,
20386  PORTS_CN_PIN cnPins ) ;
20387 // *****************************************************************************
20388 /* Function:
20389  void PLIB_PORTS_ChangeNoticeEnable( PORTS_MODULE_ID index )
20390  Summary:
20391  Global Change Notice enable.
20392  Description:
20393  This function enables the global Change Notice feature.
20394  This function performs atomic register access.
20395  Precondition:
20396  None.
20397  Parameters:
20398  index - Identifier for the device instance to be configured
20399  Returns:
20400  None.
20401  Example:
20402  <code>
20403 
20404  // Enable Change Notification
20405  PLIB_PORTS_ChangeNoticeEnable(PORTS_ID_0);
20406 
20407  </code>
20408  Remarks:
20409  This function is only available in devices without PPS. For PPS devices, use the
20410  PLIB_PORTS_ChangeNoticePerPortTurnOn function.
20411 
20412  This feature may not be available on all devices. Please refer to the
20413  specific device data sheet to determine availability or use
20414  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20415  this feature is available.
20416 */
20417 
20418 void
20420  PORTS_MODULE_ID index ) ;
20421 // *****************************************************************************
20422 /* Function:
20423  void PLIB_PORTS_ChangeNoticeDisable( PORTS_MODULE_ID index )
20424  Summary:
20425  Global Change Notice disable.
20426  Description:
20427  This function disables the global Change Notice feature.
20428  Precondition:
20429  None.
20430  Parameters:
20431  index - Identifier for the device instance to be configured
20432  Returns:
20433  None.
20434  Example:
20435  <code>
20436 
20437  // Disable Change Notification
20438  PLIB_PORTS_ChangeNoticeDisable(PORTS_ID_0);
20439 
20440  </code>
20441  Remarks:
20442  This function is only available in devices without PPS. For PPS devices, use the
20443  PLIB_PORTS_ChangeNoticePerPortTurnOff function.
20444 
20445  This feature may not be available on all devices. Please refer to the
20446  specific device data sheet to determine availability or use
20447  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20448  this feature is available.
20449 */
20450 
20451 void
20453  PORTS_MODULE_ID index ) ;
20454 // *****************************************************************************
20455 /* Function:
20456  void PLIB_PORTS_PinChangeNoticeEnable( PORTS_MODULE_ID index,
20457  PORTS_CHANGE_NOTICE_PIN pinNum )
20458  Summary:
20459  Port pin Change Notice interrupt enable.
20460  Description:
20461  This function enables the port pin Change Notice feature.
20462  This function performs atomic register access.
20463  Precondition:
20464  None.
20465  Parameters:
20466  index - Identifier for the device instance to be configured
20467  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20468  Returns:
20469  None.
20470  Example:
20471  <code>
20472 
20473  // Enable Change Notice interrupt for pin CN13
20474  PLIB_PORTS_PinChangeNoticeEnable(PORTS_ID_0, CN13);
20475 
20476  </code>
20477  Remarks:
20478  This function is only available in devices without PPS. For PPS devices, use the
20479  PLIB_PORTS_PinChangeNoticePerPortEnable function.
20480 
20481  This feature may not be available on all devices. Please refer to the
20482  specific device data sheet to determine availability or use
20483  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20484  this feature is available.
20485 */
20486 
20487 void
20489  PORTS_MODULE_ID index ,
20490  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20491 // *****************************************************************************
20492 /* Function:
20493  void PLIB_PORTS_PinChangeNoticeDisable( PORTS_MODULE_ID index,
20494  PORTS_CHANGE_NOTICE_PIN pinNum )
20495  Summary:
20496  Port pin Change Notice disable.
20497  Description:
20498  This function disables the port pin Change Notice feature.
20499  This function performs atomic register access.
20500  Precondition:
20501  None.
20502  Parameters:
20503  index - Identifier for the device instance to be configured
20504  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20505  Returns:
20506  None.
20507  Example:
20508  <code>
20509 
20510  // Disable Change Notice interrupt for pin CN13
20511  PLIB_PORTS_PinChangeNoticeDisable(PORTS_ID_0, CN13);
20512 
20513  </code>
20514  Remarks:
20515  This function is only available in devices without PPS. For PPS devices, use the
20516  PLIB_PORTS_PinChangeNoticePerPortDisable function.
20517 
20518  This feature may not be available on all devices. Please refer to the
20519  specific device data sheet to determine availability or use
20520  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20521  this feature is available.
20522 */
20523 
20524 void
20526  PORTS_MODULE_ID index ,
20527  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20528 // *****************************************************************************
20529 /* Function:
20530  void PLIB_PORTS_ChangeNoticeInIdleEnable( PORTS_MODULE_ID index )
20531  Summary:
20532  CPU Idle mode does not affect Change Notice operation.
20533  Description:
20534  This function makes sure that Change Notice feature continues working in
20535  Idle mode.
20536  This function performs atomic register access.
20537 
20538  Precondition:
20539  None.
20540  Parameters:
20541  index - Identifier for the device instance to be configured
20542  Returns:
20543  None.
20544  Example:
20545  <code>
20546 
20547  // Change notification feature will be working even when CPU goes to
20548  // Idle mode
20549  PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_ID_0);
20550 
20551  </code>
20552  Remarks:
20553  This function is only available in devices without PPS. For PPS devices, use the
20554  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable function.
20555 
20556  This feature may not be available on all devices. Please refer to the
20557  specific device data sheet to determine availability or use
20558  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
20559  this feature is available.
20560 */
20561 
20562 void
20564  PORTS_MODULE_ID index ) ;
20565 // *****************************************************************************
20566 /* Function:
20567  void PLIB_PORTS_ChangeNoticeInIdleDisable( PORTS_MODULE_ID index )
20568  Summary:
20569  CPU Idle halts the Change Notice operation.
20570  Description:
20571  This function halts the Change Notice operation when the CPU enters
20572  Idle mode.
20573  This function performs atomic register access.
20574  Precondition:
20575  None.
20576  Parameters:
20577  index - Identifier for the device instance to be configured
20578  Returns:
20579  None.
20580  Example:
20581  <code>
20582  // Halts the Change notification operation when CPU enters Idle mode
20583  PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_ID_0);
20584 
20585  </code>
20586  Remarks:
20587  This function is only available in devices without PPS. For PPS devices, use the
20588  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable function.
20589 
20590  This feature may not be available on all devices. Please refer to the
20591  specific device data sheet to determine availability or use
20592  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
20593  this feature is available.
20594 */
20595 
20596 void
20598  PORTS_MODULE_ID index ) ;
20599 // *****************************************************************************
20600 /* Function:
20601  void PLIB_PORTS_ChangeNoticePullUpEnable( PORTS_MODULE_ID index,
20602  PORTS_CHANGE_NOTICE_PIN pinNum )
20603  Summary:
20604  Enable pull-up on input change.
20605  Description:
20606  This function enables pull-up on selected input change notification pin.
20607  This function performs atomic register access.
20608  Precondition:
20609  None.
20610  Parameters:
20611  index - Identifier for the device instance to be configured
20612  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20613  Returns:
20614  None.
20615  Example:
20616  <code>
20617 
20618  // Enable pull-up on pin CN13
20619  PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_ID_0, CN13);
20620 
20621  </code>
20622  Remarks:
20623  This function is only available in devices without PPS. For PPS devices, use the
20624  PLIB_PORTS_ChangeNoticePullUpPerPortEnable function.
20625 
20626  This feature may not be available on all devices. Please refer to the
20627  specific device data sheet to determine availability or use
20628  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
20629  this feature is available.
20630 */
20631 
20632 void
20634  PORTS_MODULE_ID index ,
20635  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20636 // *****************************************************************************
20637 /* Function:
20638  void PLIB_PORTS_ChangeNoticePullUpDisable( PORTS_MODULE_ID index,
20639  PORTS_CHANGE_NOTICE_PIN pinNum )
20640  Summary:
20641  Disable pull-up on input change.
20642  Description:
20643  This function disables pull-up on selected input change notification pin.
20644  This function performs atomic register access.
20645  Precondition:
20646  None.
20647  Parameters:
20648  index - Identifier for the device instance to be configured
20649  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20650  Returns:
20651  None.
20652  Example:
20653  <code>
20654 
20655  // Disable pull-up on pin CN13
20656  PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_ID_0, CN13);
20657 
20658  </code>
20659  Remarks:
20660  This function is only available in devices without PPS. For PPS devices, use the
20661  PLIB_PORTS_ChangeNoticePullUpPerPortDisable function.
20662 
20663  This feature may not be available on all devices. Please refer to the
20664  specific device data sheet to determine availability or use
20665  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
20666  this feature is available.
20667 */
20668 
20669 void
20671  PORTS_MODULE_ID index ,
20672  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20673 // *****************************************************************************
20674 /* Function:
20675  void PLIB_PORTS_ChannelSlewRateSelect
20676  (
20677  PORTS_MODULE_ID index,
20678  PORTS_CHANNEL channel,
20679  PORTS_DATA_MASK channelMask,
20680  PORTS_PIN_SLEW_RATE slewRate
20681  );
20682  Summary:
20683  Selects the slew rate for selected channel pins.
20684  Description:
20685  This function selects the slew rate for selected channel pins.
20686  This function does not perform atomic register access.
20687  Precondition:
20688  None.
20689  Parameters:
20690  index - Identifier for the device instance to be configured
20691  channel - Port pin channel
20692  channelMask - Identifies the pins for which slew rate has to be modified.
20693  Slew rate of the pins which corresponding bit is "1" get
20694  modified, slew rate of the other pins remains the same.
20695  slewRate - One of the possible values of PORTS_PIN_SLEW_RATE.
20696  Returns:
20697  None.
20698  Example:
20699  <code>
20700 
20701  // Make slew rate of pins RC5, RC8 and RC13 slowest
20702  PLIB_PORTS_ChannelSlewRateSelect(PORTS_ID_0,
20703  PORT_CHANNEL_C,
20704  0x2120,
20705  PORTS_PIN_SLEW_RATE_SLOWEST);
20706 
20707  </code>
20708  Remarks:
20709  This feature may not be available on all devices. Please refer to the
20710  specific device data sheet to determine availability or use
20711  PLIB_PORTS_ExistsSlewRateControl in your application to determine
20712  whether this feature is available.
20713 */
20714 
20715 void
20717  PORTS_MODULE_ID index ,
20718  PORTS_CHANNEL channel ,
20719  PORTS_DATA_MASK channelMask ,
20720  PORTS_PIN_SLEW_RATE slewRate ) ;
20721 // *****************************************************************************
20722 /* Function:
20723 PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet
20724  (
20725  PORTS_MODULE_ID index,
20726  PORTS_CHANNEL channel,
20727  PORTS_BIT_POS bitPos
20728  );
20729  Summary:
20730  Gets the slew rate for selected port pin.
20731  Description:
20732  This function gets the slew rate of selected port pin.
20733  This function does not perform atomic register access.
20734  Precondition:
20735  None.
20736  Parameters:
20737  index - Identifier for the device instance to be configured
20738  channel - Port pin channel
20739  bitPos - One of the possible values of PORTS_BIT_POS.
20740  Returns:
20741  One of the possible values of PORTS_PIN_SLEW_RATE.
20742  Example:
20743  <code>
20744  PORTS_PIN_SLEW_RATE slewRate;
20745 
20746  // Get the slew rate of pin RC1
20747  slewRate = PLIB_PORTS_PinSlewRateGet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1);
20748 
20749  </code>
20750  Remarks:
20751  This feature may not be available on all devices. Please refer to the
20752  specific device data sheet to determine availability or use
20753  PLIB_PORTS_ExistsSlewRateControl in your application to determine
20754  whether this feature is available.
20755 */
20756 
20757 PORTS_PIN_SLEW_RATE
20759  PORTS_MODULE_ID index ,
20760  PORTS_CHANNEL channel ,
20761  PORTS_BIT_POS bitPos ) ;
20762 // *****************************************************************************
20763 /* Function:
20764  void PLIB_PORTS_ChannelChangeNoticeMethodSelect
20765  (
20766  PORTS_MODULE_ID index,
20767  PORTS_CHANNEL channel,
20768  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod
20769  );
20770  Summary:
20771  Selects the Change Notice style for selected port channel.
20772  Description:
20773  This function selects the Change Notice style (or method) for selected port
20774  channel. It allows user to select whether the Change Notice detection will
20775  happen based on edge transition or level transition on all the CN pins of a
20776  particular channel.
20777  This function does not perform atomic register access.
20778  Precondition:
20779  None.
20780  Parameters:
20781  index - Identifier for the device instance to be configured
20782  channel - Port pin channel
20783  changeNoticeMethod - One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
20784  Returns:
20785  None.
20786  Example:
20787  <code>
20788  PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_ID_0, PORT_CHANNEL_C,
20789  PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT);
20790  </code>
20791  Remarks:
20792  This feature may not be available on all devices. Please refer to the
20793  specific device data sheet to determine availability or use
20794  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
20795  whether this feature is available.
20796 */
20797 
20798 void
20800  PORTS_MODULE_ID index ,
20801  PORTS_CHANNEL channel ,
20802  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod ) ;
20803 // *****************************************************************************
20804 /* Function:
20805  PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet
20806  (
20807  PORTS_MODULE_ID index,
20808  PORTS_CHANNEL channel
20809  );
20810  Summary:
20811  Gets the Change Notice style for the selected port channel.
20812  Description:
20813  This function gets the Change Notice style (or method) for the selected port
20814  channel.
20815  This function does not perform atomic register access.
20816  Precondition:
20817  None.
20818  Parameters:
20819  index - Identifier for the device instance to be configured
20820  channel - Port pin channel
20821  Returns:
20822  One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
20823  Example:
20824  <code>
20825  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod;
20826  changeNoticeMethod = PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_ID_0, PORT_CHANNEL_C);
20827  </code>
20828  Remarks:
20829  This feature may not be available on all devices. Please refer to the
20830  specific device data sheet to determine availability or use
20831  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
20832  whether this feature is available.
20833 */
20834 
20835 PORTS_CHANGE_NOTICE_METHOD
20837  PORTS_MODULE_ID index ,
20838  PORTS_CHANNEL channel ) ;
20839 // *****************************************************************************
20840 /* Function:
20841  void PLIB_PORTS_ChannelChangeNoticeEdgeEnable
20842  (
20843  PORTS_MODULE_ID index,
20844  PORTS_CHANNEL channel,
20845  PORTS_DATA_MASK edgeRisingMask,
20846  PORTS_DATA_MASK edgeFallingMask
20847  );
20848  Summary:
20849  Enables selected type of edge for selected CN pins.
20850  Description:
20851  This function Enables selected type of edge (falling or rising) for
20852  selected CN pins of a port channel.
20853  This function does not perform atomic register access.
20854  Precondition:
20855  Change Notice method should be selected as
20856  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
20857  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
20858  Parameters:
20859  index - Identifier for the device instance to be configured
20860  channel - Port pin channel
20861  edgeRisingMask - Identifies the pins for which Change Notice has to be
20862  enabled for rising edge. Change Notice interrupt at rising
20863  edge is enabled for the pins which corresponding bit is
20864  '1', for the other pins it remains the same.
20865  edgeFallingMask - Identifies the pins for which Change Notice has to be
20866  enabled for falling edge. Change Notice interrupt at
20867  falling edge is enabled for the pins which corresponding
20868  bit is '1', for the other pins it remains the same.
20869  Returns:
20870  None.
20871  Example:
20872  <code>
20873  // Enable Change Notice at rising edge for RC1 pin and at falling edge for
20874  // RC1 & RC5 pins.
20875  PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
20876  </code>
20877  Remarks:
20878  This feature is not available on all devices. Please refer to the
20879  specific device data sheet to determine availability or use
20880  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20881  whether this feature is available.
20882 */
20883 
20884 void
20886  PORTS_MODULE_ID index ,
20887  PORTS_CHANNEL channel ,
20888  PORTS_DATA_MASK edgeRisingMask ,
20889  PORTS_DATA_MASK edgeFallingMask ) ;
20890 // *****************************************************************************
20891 /* Function:
20892  void PLIB_PORTS_ChannelChangeNoticeEdgeDisable
20893  (
20894  PORTS_MODULE_ID index,
20895  PORTS_CHANNEL channel,
20896  PORTS_DATA_MASK edgeRisingMask,
20897  PORTS_DATA_MASK edgeFallingMask
20898  );
20899  Summary:
20900  Disables selected type of edge for selected CN pins.
20901  Description:
20902  This function Disables selected type of edge (falling or rising) for
20903  selected CN pins of a port channel.
20904  This function does not perform atomic register access.
20905  Precondition:
20906  Change Notice method should be selected as
20907  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
20908  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
20909  Parameters:
20910  index - Identifier for the device instance to be configured
20911  channel - Port pin channel
20912  edgeRisingMask - Identifies the pins for which Change Notice has to be
20913  enabled for rising edge. Change notice interrupt at rising
20914  edge is enabled for the pins which corresponding bit is
20915  '1', for the other pins it remains the same.
20916  edgeFallingMask - Identifies the pins for which Change Notice has to be
20917  enabled for falling edge. Change notice interrupt at
20918  falling edge is enabled for the pins which corresponding
20919  bit is '1', for the other pins it remains the same.
20920  Returns:
20921  None.
20922  Example:
20923  <code>
20924  // Disable Change Notice at rising edge for RC1 pin and at falling edge for
20925  // RC1 & RC5 pins.
20926  PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
20927  </code>
20928  Remarks:
20929  This feature is not available on all devices. Please refer to the
20930  specific device data sheet to determine availability or use
20931  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20932  whether this feature is available.
20933 */
20934 
20935 void
20937  PORTS_MODULE_ID index ,
20938  PORTS_CHANNEL channel ,
20939  PORTS_DATA_MASK edgeRisingMask ,
20940  PORTS_DATA_MASK edgeFallingMask ) ;
20941 // *****************************************************************************
20942 /* Function:
20943  bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
20944  (
20945  PORTS_MODULE_ID index,
20946  PORTS_CHANNEL channel,
20947  PORTS_BIT_POS bitPos,
20948  PORTS_CHANGE_NOTICE_EDGE cnEdgeType
20949  );
20950  Summary:
20951  Check if Change Notice edge is enabled or not.
20952  This function does not perform atomic register access.
20953  Description:
20954  This function checks if selected type of Change Notice edge is enabled on a
20955  particular port pin or not.
20956  This function does not perform atomic register access.
20957  Precondition:
20958  None.
20959  Parameters:
20960  index - Identifier for the device instance to be configured
20961  channel - Port pin channel
20962  bitPos - One of the possible values of PORTS_BIT_POS.
20963  cnEdgeType - Type of the edge which has to be checked.
20964 
20965  Returns:
20966  - true - Selected type of Change Notice Edge is enabled.
20967  - false - Selected type of Change Notice Edge is not enabled.
20968 
20969  Example:
20970  <code>
20971  // Check if Change Notice at rising edge is enabled or not for pin RC1.
20972  if (PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1, PORTS_CHANGE_NOTICE_EDGE_RISING))
20973  {
20974  // do something
20975  }
20976  </code>
20977  Remarks:
20978  This feature is not available on all devices. Please refer to the
20979  specific device data sheet to determine availability or use
20980  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20981  whether this feature is available.
20982 */
20983 
20984 bool
20986  PORTS_MODULE_ID index ,
20987  PORTS_CHANNEL channel ,
20988  PORTS_BIT_POS bitPos ,
20989  PORTS_CHANGE_NOTICE_EDGE cnEdgeType ) ;
20990 // *****************************************************************************
20991 /* Function:
20992  bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
20993  (
20994  PORTS_MODULE_ID index,
20995  PORTS_CHANNEL channel,
20996  PORTS_BIT_POS bitPos
20997  );
20998  Summary:
20999  Check Change Notice edge status.
21000  Description:
21001  This function checks whether or no a Change Notice edge transition has occurred
21002  on the selected port pin.
21003  This function does not perform atomic register access.
21004  Precondition:
21005  None.
21006  Parameters:
21007  index - Identifier for the device instance to be configured
21008  channel - Port pin channel
21009  bitPos - One of the possible values of PORTS_BIT_POS
21010 
21011  Returns:
21012  - true - Change Notice edge transition has occurred
21013  - false - Change Notice edge transition has not occurred
21014 
21015  Example:
21016  <code>
21017  // Check if Change Notice edge transition has occurred for pin RC1.
21018  if (PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1))
21019  {
21020  // do something
21021  }
21022  </code>
21023  Remarks:
21024  This feature is not available on all devices. Please refer to the
21025  specific device data sheet to determine availability or use
21026  PLIB_PORTS_ExistsChangeNoticeEdgeStatus in your application to determine
21027  whether this feature is available.
21028 */
21029 
21030 bool
21032  PORTS_MODULE_ID index ,
21033  PORTS_CHANNEL channel ,
21034  PORTS_BIT_POS bitPos ) ;
21035 // *****************************************************************************
21036 // *****************************************************************************
21037 // Section: Ports Peripheral Library Exists Functions
21038 // *****************************************************************************
21039 // *****************************************************************************
21040 /* The functions below indicate the existence of the features on the device.
21041 */
21042 //******************************************************************************
21043 /* Function:
21044  PLIB_PORTS_ExistsRemapInput( PORTS_MODULE_ID index )
21045  Summary:
21046  Identifies whether the RemapInput feature exists on the Ports module.
21047  Description:
21048  This function identifies whether the RemapInput feature is available on the
21049  Ports module.
21050  When this function returns true, this function is supported on the device:
21051  - PLIB_PORTS_RemapInput
21052  Preconditions:
21053  None.
21054  Parameters:
21055  index - Identifier for the device instance
21056  Returns:
21057  - true - The RemapInput feature is supported on the device
21058  - false - The RemapInput feature is not supported on the device
21059  Remarks:
21060  None.
21061 */
21062 
21063 bool
21065  PORTS_MODULE_ID index ) ;
21066 //******************************************************************************
21067 /* Function:
21068  PLIB_PORTS_ExistsRemapOutput( PORTS_MODULE_ID index )
21069  Summary:
21070  Identifies whether the RemapOutput feature exists on the Ports module.
21071  Description:
21072  This function identifies whether the RemapOutput feature is available on the
21073  Ports module.
21074  When this function returns true, this function is supported on the device:
21075  - PLIB_PORTS_RemapOutput
21076  Preconditions:
21077  None.
21078  Parameters:
21079  index - Identifier for the device instance
21080  Returns:
21081  - true - The RemapOutput feature is supported on the device
21082  - false - The RemapOutput feature is not supported on the device
21083  Remarks:
21084  None.
21085 */
21086 
21087 bool
21089  PORTS_MODULE_ID index ) ;
21090 //******************************************************************************
21091 /* Function:
21092  PLIB_PORTS_ExistsPinMode( PORTS_MODULE_ID index )
21093  Summary:
21094  Identifies whether the PinMode feature exists on the Ports module.
21095  Description:
21096  This function identifies whether the PinMode (Analog Pin or Digital Pin)
21097  feature is available on the Ports module.
21098  When this function returns true, this function is supported on the device:
21099  - PLIB_PORTS_PinModeSelect
21100  Preconditions:
21101  None.
21102  Parameters:
21103  index - Identifier for the device instance
21104  Returns:
21105  - true - The PinMode feature is supported on the device
21106  - false - The PinMode feature is not supported on the device
21107  Remarks:
21108  None.
21109 */
21110 
21111 bool
21113  PORTS_MODULE_ID index ) ;
21114 //******************************************************************************
21115 /* Function:
21116  PLIB_PORTS_ExistsAnPinsMode( PORTS_MODULE_ID index )
21117  Summary:
21118  Identifies whether the AnPinsMode feature exists on the Ports module.
21119  Description:
21120  This function identifies whether the AnPinsMode feature is available on the
21121  Ports module.
21122  When this function returns true, this function is supported on the device:
21123  - PLIB_PORTS_AnPinsModeSelect
21124  Preconditions:
21125  None.
21126  Parameters:
21127  index - Identifier for the device instance
21128  Returns:
21129  - true - The AnPinsMode feature is supported on the device
21130  - false - The AnPinsMode feature is not supported on the device
21131  Remarks:
21132  None.
21133 */
21134 
21135 bool
21137  PORTS_MODULE_ID index ) ;
21138 //******************************************************************************
21139 /* Function:
21140  PLIB_PORTS_ExistsPortsRead( PORTS_MODULE_ID index )
21141  Summary:
21142  Identifies whether the PortsRead feature exists on the Ports module.
21143  Description:
21144  This function identifies whether the PortsRead feature is available on the
21145  Ports module.
21146  When this function returns true, these functions are supported on the device:
21147  - PLIB_PORTS_PinGet
21148  - PLIB_PORTS_Read
21149  Preconditions:
21150  None.
21151  Parameters:
21152  index - Identifier for the device instance
21153  Returns:
21154  - true - The PortsRead feature is supported on the device
21155  - false - The PortsRead feature is not supported on the device
21156  Remarks:
21157  None.
21158 */
21159 
21160 bool
21162  PORTS_MODULE_ID index ) ;
21163 //******************************************************************************
21164 /* Function:
21165  PLIB_PORTS_ExistsLatchRead( PORTS_MODULE_ID index )
21166  Summary:
21167  Identifies whether the LatchRead feature exists on the Ports module.
21168  Description:
21169  This function identifies whether the LatchRead feature is available on the
21170  Ports module.
21171  When this function returns true, these functions are supported on the device:
21172  - PLIB_PORTS_PinGetLatched
21173  - PLIB_PORTS_ReadLatched
21174  Preconditions:
21175  None.
21176  Parameters:
21177  index - Identifier for the device instance
21178  Returns:
21179  - true - The LatchRead feature is supported on the device
21180  - false - The LatchRead feature is not supported on the device
21181  Remarks:
21182  None.
21183 */
21184 
21185 bool
21187  PORTS_MODULE_ID index ) ;
21188 //******************************************************************************
21189 /* Function:
21190  PLIB_PORTS_ExistsPortsWrite( PORTS_MODULE_ID index )
21191  Summary:
21192  Identifies whether the PortsWrite feature exists on the Ports module.
21193  Description:
21194  This function identifies whether the PortsWrite feature is available on the
21195  Ports module.
21196  When this function returns true, these functions are supported on the device:
21197  - PLIB_PORTS_PinWrite
21198  - PLIB_PORTS_PinSet
21199  - PLIB_PORTS_PinClear
21200  - PLIB_PORTS_PinToggle
21201  - PLIB_PORTS_Write
21202  - PLIB_PORTS_Set
21203  - PLIB_PORTS_Toggle
21204  - PLIB_PORTS_Clear
21205  Preconditions:
21206  None.
21207  Parameters:
21208  index - Identifier for the device instance
21209  Returns:
21210  - true - The PortsWrite feature is supported on the device
21211  - false - The PortsWrite feature is not supported on the device
21212  Remarks:
21213  None.
21214 */
21215 
21216 bool
21218  PORTS_MODULE_ID index ) ;
21219 //******************************************************************************
21220 /* Function:
21221  PLIB_PORTS_ExistsPortsDirection( PORTS_MODULE_ID index )
21222  Summary:
21223  Identifies whether the PortsDirection feature exists on the Ports module.
21224  Description:
21225  This function identifies whether the PortsDirection feature is available on the
21226  Ports module.
21227  When this function returns true, these functions are supported on the device:
21228  - PLIB_PORTS_PinDirectionInputSet
21229  - PLIB_PORTS_PinDirectionOutputSet
21230  - PLIB_PORTS_DirectionInputSet
21231  - PLIB_PORTS_DirectionOutputSet
21232  - PLIB_PORTS_DirectionGet
21233  Preconditions:
21234  None.
21235  Parameters:
21236  index - Identifier for the device instance
21237  Returns:
21238  - true - The PortsDirection feature is supported on the device
21239  - false - The PortsDirection feature is not supported on the device
21240  Remarks:
21241  None.
21242 */
21243 
21244 bool
21246  PORTS_MODULE_ID index ) ;
21247 //******************************************************************************
21248 /* Function:
21249  PLIB_PORTS_ExistsPortsOpenDrain( PORTS_MODULE_ID index )
21250  Summary:
21251  Identifies whether the PortsOpenDrain feature exists on the Ports module.
21252  Description:
21253  This function identifies whether the PortsOpenDrain feature is available on
21254  the Ports module.
21255  When this function returns true, these functions are supported on the device:
21256  - PLIB_PORTS_PinOpenDrainEnable
21257  - PLIB_PORTS_PinOpenDrainDisable
21258  - PLIB_PORTS_OpenDrainEnable
21259  - PLIB_PORTS_OpenDrainDisable
21260  Preconditions:
21261  None.
21262  Parameters:
21263  index - Identifier for the device instance
21264  Returns:
21265  - true - The PortsOpenDrain feature is supported on the device
21266  - false - The PortsOpenDrain feature is not supported on the device
21267  Remarks:
21268  None.
21269 */
21270 
21271 bool
21273  PORTS_MODULE_ID index ) ;
21274 //******************************************************************************
21275 /* Function:
21276  PLIB_PORTS_ExistsChangeNotice( PORTS_MODULE_ID index )
21277  Summary:
21278  Identifies whether the ChangeNotice feature exists on the Ports module.
21279  Description:
21280  This function identifies whether the ChangeNotice feature is available on the
21281  Ports module.
21282  When this function returns true, these functions are supported on the device:
21283  - PLIB_PORTS_ChangeNoticeEnable
21284  - PLIB_PORTS_ChangeNoticeDisable
21285  Preconditions:
21286  None.
21287  Parameters:
21288  index - Identifier for the device instance
21289  Returns:
21290  - true - The ChangeNotice feature is supported on the device
21291  - false - The ChangeNotice feature is not supported on the device
21292  Remarks:
21293  None.
21294 */
21295 
21296 bool
21298  PORTS_MODULE_ID index ) ;
21299 //******************************************************************************
21300 /* Function:
21301  PLIB_PORTS_ExistsPinChangeNotice( PORTS_MODULE_ID index )
21302  Summary:
21303  Identifies whether the PinChangeNotice feature exists on the Ports module.
21304  Description:
21305  This function identifies whether the PinChangeNotice feature is available on
21306  the Ports module.
21307  When this function returns true, these functions are supported on the device:
21308  - PLIB_PORTS_PinChangeNoticeEnable
21309  - PLIB_PORTS_PinChangeNoticeDisable
21310  - PLIB_PORTS_CnPinsEnable
21311  - PLIB_PORTS_CnPinsDisable
21312  Preconditions:
21313  None.
21314  Parameters:
21315  index - Identifier for the device instance
21316  Returns:
21317  - true - The PinChangeNotice feature is supported on the device
21318  - false - The PinChangeNotice feature is not supported on the device
21319  Remarks:
21320  None.
21321 */
21322 
21323 bool
21325  PORTS_MODULE_ID index ) ;
21326 //******************************************************************************
21327 /* Function:
21328  PLIB_PORTS_ExistsChangeNoticeInIdle( PORTS_MODULE_ID index )
21329  Summary:
21330  Identifies whether the ChangeNoticeInIdle feature exists on the Ports module.
21331  Description:
21332  This function identifies whether the ChangeNoticeInIdle feature is available
21333  on the Ports module.
21334  When this function returns true, these functions are supported on the device:
21335  - PLIB_PORTS_ChangeNoticeInIdleEnable
21336  - PLIB_PORTS_ChangeNoticeInIdleDisable
21337  Preconditions:
21338  None.
21339  Parameters:
21340  index - Identifier for the device instance
21341  Returns:
21342  - true - The ChangeNoticeInIdle feature is supported on the device
21343  - false - The ChangeNoticeInIdle feature is not supported on the device
21344  Remarks:
21345  None.
21346 */
21347 
21348 bool
21350  PORTS_MODULE_ID index ) ;
21351 //******************************************************************************
21352 /* Function:
21353  PLIB_PORTS_ExistsChangeNoticePullUp( PORTS_MODULE_ID index )
21354  Summary:
21355  Identifies whether the ChangeNoticePullup feature exists on the Ports module.
21356  Description:
21357  This function identifies whether the ChangeNoticePullup feature is available
21358  on the Ports module.
21359  When this function returns true, these functions are supported on the device:
21360  - PLIB_PORTS_ChangeNoticePullUpEnable
21361  - PLIB_PORTS_ChangeNoticePullUpDisable
21362  - PLIB_PORTS_CnPinsPullUpEnable
21363  - PLIB_PORTS_CnPinsPullUpDisable
21364  Preconditions:
21365  None.
21366  Parameters:
21367  index - Identifier for the device instance
21368  Returns:
21369  - true - The ChangeNoticePullup feature is supported on the device
21370  - false - The ChangeNoticePullup feature is not supported on the device
21371  Remarks:
21372  None.
21373 */
21374 
21375 bool
21377  PORTS_MODULE_ID index ) ;
21378 //******************************************************************************
21379 /* Function:
21380  PLIB_PORTS_ExistsPinModePerPort( PORTS_MODULE_ID index )
21381  Summary:
21382  Identifies whether the PinModePerPort feature exists on the Ports module.
21383  Description:
21384  This function identifies whether the PinModePerPort (Analog Pin or Digital Pin)
21385  feature is available on the Ports module.
21386  When this function returns true, these functions are supported on the device:
21387  - PLIB_PORTS_PinModePerPortSelect
21388  - PLIB_PORTS_ChannelModeSelect
21389  Preconditions:
21390  None.
21391  Parameters:
21392  index - Identifier for the device instance
21393  Returns:
21394  - true - The PinModePerPort feature is supported on the device
21395  - false - The PinModePerPort feature is not supported on the device
21396  Remarks:
21397  None.
21398 */
21399 
21400 bool
21402  PORTS_MODULE_ID index ) ;
21403 //******************************************************************************
21404 /* Function:
21405  PLIB_PORTS_ExistsChangeNoticePullDownPerPort( PORTS_MODULE_ID index )
21406  Summary:
21407  Identifies whether the ChangeNoticePullDownPerPort feature exists on the
21408  Ports module.
21409  Description:
21410  This function identifies whether the ChangeNoticePullDownPerPort feature is
21411  available on the Ports module.
21412  When this function returns true, these functions are supported on the device:
21413  - PLIB_PORTS_ChangeNoticePullDownPerPortEnable
21414  - PLIB_PORTS_ChangeNoticePullDownPerPortDisable
21415  - PLIB_PORTS_ChannelChangeNoticePullDownEnable
21416  - PLIB_PORTS_ChannelChangeNoticePullDownDisable
21417  Preconditions:
21418  None.
21419  Parameters:
21420  index - Identifier for the device instance
21421  Returns:
21422  - true - The ChangeNoticePullDownPerPort feature is supported on the device
21423  - false - The ChangeNoticePullDownPerPort feature is not supported on the device
21424  Remarks:
21425  None.
21426 */
21427 
21428 bool
21430  PORTS_MODULE_ID index ) ;
21431 //******************************************************************************
21432 /* Function:
21433  PLIB_PORTS_ExistsChangeNoticePullUpPerPort( PORTS_MODULE_ID index )
21434  Summary:
21435  Identifies whether the ChangeNoticePullUpPerPort feature exists on the Ports
21436  module.
21437  Description:
21438  This function identifies whether the ChangeNoticePullUpPerPort feature is available
21439  on the Ports module.
21440  When this function returns true, these functions are supported on the device:
21441  - PLIB_PORTS_ChangeNoticePullUpPerPortEnable
21442  - PLIB_PORTS_ChangeNoticePullUpPerPortDisable
21443  - PLIB_PORTS_ChannelChangeNoticePullUpEnable
21444  - PLIB_PORTS_ChannelChangeNoticePullUpDisable
21445  Preconditions:
21446  None.
21447  Parameters:
21448  index - Identifier for the device instance
21449  Returns:
21450  - true - The ChangeNoticePullUpPerPort feature is supported on the device
21451  - false - The ChangeNoticePullUpPerPort feature is not supported on the device
21452  Remarks:
21453  None.
21454 */
21455 
21456 bool
21458  PORTS_MODULE_ID index ) ;
21459 //******************************************************************************
21460 /* Function:
21461  PLIB_PORTS_ExistsPinChangeNoticePerPort( PORTS_MODULE_ID index )
21462  Summary:
21463  Identifies whether the PinChangeNoticePerPort feature exists on the Ports
21464  module.
21465  Description:
21466  This function identifies whether the PinChangeNoticePerPort feature is
21467  available on the Ports module.
21468  When this function returns true, these functions are supported on the device:
21469  - PLIB_PORTS_PinChangeNoticePerPortEnable
21470  - PLIB_PORTS_PinChangeNoticePerPortDisable
21471  - PLIB_PORTS_ChannelChangeNoticeEnable
21472  - PLIB_PORTS_ChannelChangeNoticeDisable
21473  Preconditions:
21474  None.
21475  Parameters:
21476  index - Identifier for the device instance
21477  Returns:
21478  - true - The PinChangeNoticePerPort feature is supported on the device
21479  - false - The PinChangeNoticePerPort feature is not supported on the device
21480  Remarks:
21481  None.
21482 */
21483 
21484 bool
21486  PORTS_MODULE_ID index ) ;
21487 //******************************************************************************
21488 /* Function:
21489  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn( PORTS_MODULE_ID index )
21490  Summary:
21491  Identifies whether the ChangeNoticePerPortTurnOn feature exists on the Ports
21492  module.
21493  Description:
21494  This function identifies whether the ChangeNoticePerPortTurnOn feature is
21495  available on the Ports module.
21496  When this function returns true, these functions are supported on the device:
21497  - PLIB_PORTS_ChangeNoticePerPortTurnOn
21498  - PLIB_PORTS_ChangeNoticePerPortTurnOff
21499  Preconditions:
21500  None.
21501  Parameters:
21502  index - Identifier for the device instance
21503  Returns:
21504  - true - The ChangeNoticePerPortTurnOn feature is supported on the device
21505  - false - The ChangeNoticePerPortTurnOn feature is not supported on the device
21506  Remarks:
21507  None.
21508 */
21509 
21510 bool
21512  PORTS_MODULE_ID index ) ;
21513 //******************************************************************************
21514 /* Function:
21515  PLIB_PORTS_ExistsChangeNoticePerPortInIdle( PORTS_MODULE_ID index )
21516  Summary:
21517  Identifies whether the ChangeNoticeInIdlePerPort feature exists on the Ports
21518  module.
21519  Description:
21520  This function identifies whether the ChangeNoticeInIdlePerPort feature is
21521  available on the Ports module.
21522  When this function returns true, these functions are supported on the device:
21523  - PLIB_PORTS_ChangeNoticeInIdlePerPortEnable
21524  - PLIB_PORTS_ChangeNoticeInIdlePerPortDisable
21525  Preconditions:
21526  None.
21527  Parameters:
21528  index - Identifier for the device instance
21529  Returns:
21530  - true - The ChangeNoticeInIdlePerPort feature is supported on the device
21531  - false - The ChangeNoticeInIdlePerPort feature is not supported on the device
21532  Remarks:
21533  None.
21534 */
21535 
21536 bool
21538  PORTS_MODULE_ID index ) ;
21539 //******************************************************************************
21540 /* Function:
21541  PLIB_PORTS_ExistsChangeNoticePerPortStatus( PORTS_MODULE_ID index )
21542  Summary:
21543  Identifies whether the ChangeNoticePerPortStatus feature exists on the Ports
21544  module.
21545  Description:
21546  This function identifies whether the ChangeNoticePerPortStatus feature is
21547  available on the Ports module.
21548  When this function returns true, these functions are supported on the device:
21549  - PLIB_PORTS_ChangeNoticePerPortHasOccured
21550  - PLIB_PORTS_ChangeNoticePerPortHasOccurred
21551  Preconditions:
21552  None.
21553  Parameters:
21554  index - Identifier for the device instance
21555  Returns:
21556  - true - The ChangeNoticePerPortStatus feature is supported on the device
21557  - false - The ChangeNoticePerPortStatus feature is not supported on the device
21558  Remarks:
21559  None.
21560 */
21561 
21562 bool
21564  PORTS_MODULE_ID index ) ;
21565 //******************************************************************************
21566 /* Function:
21567  PLIB_PORTS_ExistsSlewRateControl( PORTS_MODULE_ID index )
21568  Summary:
21569  Identifies whether the SlewRateControl feature exists on the Ports module.
21570  Description:
21571  This function identifies whether the SlewRateControl feature is available
21572  on the Ports module.
21573  When this function returns true, these functions are supported on the device:
21574  - PLIB_PORTS_ChannelSlewRateSelect
21575  - PLIB_PORTS_PinSlewRateGet
21576  Preconditions:
21577  None.
21578  Parameters:
21579  index - Identifier for the device instance
21580  Returns:
21581  - true - The SlewRateControl feature is supported on the device
21582  - false - The SlewRateControl feature is not supported on the device
21583  Remarks:
21584  None.
21585 */
21586 
21587 bool
21589  PORTS_MODULE_ID index ) ;
21590 //******************************************************************************
21591 /* Function:
21592  PLIB_PORTS_ExistsChannelChangeNoticeMethod( PORTS_MODULE_ID index )
21593  Summary:
21594  Identifies whether the ChannelChangeNoticeMethod feature exists on the
21595  Ports module.
21596  Description:
21597  This function identifies whether the ChannelChangeNoticeMethod feature is
21598  available on the Ports module.
21599  When this function returns true, these functions are supported on the device:
21600  - PLIB_PORTS_ChannelChangeNoticeMethodSelect
21601  - PLIB_PORTS_ChannelChangeNoticeMethodGet
21602  Preconditions:
21603  None.
21604  Parameters:
21605  index - Identifier for the device instance
21606  Returns:
21607  - true - The ChannelChangeNoticeMethod feature is supported on the device
21608  - false - The ChannelChangeNoticeMethod feature is not supported on the device
21609  Remarks:
21610  None.
21611 */
21612 
21613 bool
21615  PORTS_MODULE_ID index ) ;
21616 //******************************************************************************
21617 /* Function:
21618  PLIB_PORTS_ExistsChangeNoticeEdgeControl( PORTS_MODULE_ID index )
21619  Summary:
21620  Identifies whether the ChangeNoticeEdgeControl feature exists on the Ports
21621  module.
21622  Description:
21623  This function identifies whether the ChangeNoticeEdgeControl feature is
21624  available on the Ports module.
21625  When this function returns true, these functions are supported on the device:
21626  - PLIB_PORTS_ChannelChangeNoticeEdgeEnable
21627  - PLIB_PORTS_ChannelChangeNoticeEdgeDisable
21628  - PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
21629  Preconditions:
21630  None.
21631  Parameters:
21632  index - Identifier for the device instance
21633  Returns:
21634  - true - The ChangeNoticeEdgeControl feature is supported on the device
21635  - false - The ChangeNoticeEdgeControl feature is not supported on the device
21636  Remarks:
21637  None.
21638 */
21639 
21640 bool
21642  PORTS_MODULE_ID index ) ;
21643 //******************************************************************************
21644 /* Function:
21645  PLIB_PORTS_ExistsChangeNoticeEdgeStatus( PORTS_MODULE_ID index )
21646  Summary:
21647  Identifies whether the ChangeNoticeEdgeStatus feature exists on the Ports
21648  module.
21649  Description:
21650  This function identifies whether the ChangeNoticeEdgeStatus feature is available
21651  on the Ports module.
21652  When this function returns true, this function is supported on the device:
21653  - PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
21654  Preconditions:
21655  None.
21656  Parameters:
21657  index - Identifier for the device instance
21658  Returns:
21659  - true - The ChangeNoticeEdgeStatus feature is supported on the device
21660  - false - The ChangeNoticeEdgeStatus feature is not supported on the device
21661  Remarks:
21662  None.
21663 */
21664 
21665 bool
21667  PORTS_MODULE_ID index ) ;
21668 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h */
21669 /*******************************************************************************
21670  Ports Peripheral Library Compatibility Header
21671  Company:
21672  Microchip Technology Inc.
21673  File Name:
21674  plib_ports_compatibility.h
21675  Summary:
21676  Ports Peripheral Library Interface header for backward compatibility.
21677  Description:
21678  This header file contains the definitions of the functions which are
21679  supported for backward compatibility only. These will be deprecated later.
21680 *******************************************************************************/
21681 // DOM-IGNORE-BEGIN
21682 /*******************************************************************************
21683 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
21684 Microchip licenses to you the right to use, modify, copy and distribute
21685 Software only when embedded on a Microchip microcontroller or digital signal
21686 controller that is integrated into your product or third party product
21687 (pursuant to the sublicense terms in the accompanying license agreement).
21688 You should refer to the license agreement accompanying this Software for
21689 additional information regarding your rights and obligations.
21690 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
21691 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
21692 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
21693 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
21694 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
21695 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
21696 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
21697 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
21698 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
21699 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
21700 *******************************************************************************/
21701 // DOM-IGNORE-END
21702 #ifndef _PLIB_PORTS_COMPATIBILITY_H
21703 #define _PLIB_PORTS_COMPATIBILITY_H
21704 #include <stdint.h>
21705 #include <stddef.h>
21706 // *****************************************************************************
21707 /* Function:
21708  bool PLIB_PORTS_ChangeNoticePerPortHasOccured ( PORTS_MODULE_ID index,
21709  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
21710  Summary:
21711  checks the status of change on the pin
21712  Description:
21713  This function checks if the change has occurred on the given pin or not.
21714  Precondition:
21715  None.
21716  Parameters:
21717  index - Identifier for the device instance to be configured
21718  channel - Port pin channel
21719  bitPos - Position in the PORT pins
21720  Returns:
21721  None.
21722  Example:
21723  <code>
21724 
21725  if(PLIB_PORTS_ChangeNoticePerPortHasOccured( PORTS_ID_0,
21726  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
21727  {
21728  //do something
21729  }
21730 
21731  </code>
21732  Remarks:
21733  This feature may not be available on all devices. Please refer to the
21734  specific device data sheet to determine availability or use
21735  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
21736  whether this feature is available.
21737 
21738  This function will be deprecated later.
21739 */
21740 #define PLIB_PORTS_ChangeNoticePerPortHasOccured PLIB_PORTS_ChangeNoticePerPortHasOccurred
21741  // #ifndef _PLIB_PORTS_COMPATIBILITY_H
21742 /*******************************************************************************
21743  End of File
21744 */
21745 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h*/
21746 /* CLOSE_FILE Include File */
21747 
21748 //DOM-IGNORE-BEGIN
21749 //DOM-IGNORE-END
21750  // #ifndef _PLIB_PORTS_H
21751 /*******************************************************************************
21752  End of File
21753 */
21754 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h*/
21755 /* CLOSE_FILE Include File */
21756 
21757 #include "system/int/sys_int.h"
21758 // *****************************************************************************
21759 // *****************************************************************************
21760 // Section: SYS PORTS Data Types
21761 // *****************************************************************************
21762 // *****************************************************************************
21763 // *****************************************************************************
21764 /* SYS PORTS PULLUP status
21765  Summary:
21766  Provides the pull-up and pull-down status.
21767  Description:
21768  These constants provide the pull-up or pull-down status definitions.
21769  Remarks:
21770  None.
21771 */
21772 
21773 typedef
21774  enum
21775  {
21776  /* PULLUP Disable */
21778  /*DOM-IGNORE-BEGIN*/
21779  = 0 /*DOM-IGNORE-END*/
21780  ,
21781  /* PULLUP Enable */
21783  /*DOM-IGNORE-BEGIN*/
21784  = 1 /*DOM-IGNORE-END*/
21785  ,
21787 // *****************************************************************************
21788 /* SYS PORTS PIN DIRECTION
21789  Summary:
21790  Defines the direction of the port pins.
21791  Description:
21792  These constants provide the port pin direction definitions.
21793  Remarks:
21794  None.
21795 */
21796 
21797 typedef
21798  enum
21799  {
21800  /* Direction as output */
21802  /*DOM-IGNORE-BEGIN*/
21803  = 0 /*DOM-IGNORE-END*/
21804  ,
21805  /* Direction as input */
21807  /*DOM-IGNORE-BEGIN*/
21808  = 1 /*DOM-IGNORE-END*/
21809  ,
21811 
21812 typedef
21813  enum
21814  {
21817  // #ifndef _SYS_PORTS_DEFINITIONS_H
21818 /*******************************************************************************
21819  End of File
21820 */
21821 
21822 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h*/
21823 /* CLOSE_FILE Include File */
21824 
21825 // DOM-IGNORE-BEGIN
21826 // DOM-IGNORE-END
21827 // *****************************************************************************
21828 // *****************************************************************************
21829 // Section: SYS PorTS Module Initialization Routine
21830 // *****************************************************************************
21831 // *****************************************************************************
21832 // *****************************************************************************
21833 /* Function:
21834  void SYS_PORTS_Initialize()
21835  Summary:
21836  Initializes PORT Pins/Channels.
21837  <p><b>Implementation:</b> Static/Dynamic</p>
21838  Description:
21839  This function initializes different port pins/channels to the desired state.
21840  It also remaps the pins to the desired specific function.
21841  Precondition:
21842  None.
21843  Parameters:
21844  None.
21845  Returns:
21846  None.
21847  Example:
21848  <code>
21849  SYS_PORTS_Initialize();
21850  </code>
21851  Remarks:
21852  This API must be be called at the time of system initialization to
21853  initialize the ports pins.
21854 */
21855 
21856 void
21858 // *****************************************************************************
21859 // *****************************************************************************
21860 // Section: SYS PORTS CONTROL Routines
21861 // *****************************************************************************
21862 // *****************************************************************************
21863 // *****************************************************************************
21864 /* Function:
21865  PORTS_DATA_TYPE SYS_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
21866  Summary:
21867  Reads the data from the I/O port.
21868  <p><b>Implementation:</b> Dynamic</p>
21869  Description:
21870  This function reads the data from the I/O port.
21871  Preconditions:
21872  The direction of the port to be set as input.
21873  Parameters:
21874  index - Identifier for the device instance to be configured
21875  channel - Identifier for the PORT channel: A, B, C, etc.
21876  Returns:
21877  Returns the data read from the port.
21878  Example:
21879  <code>
21880  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21881  // application developer.
21882  PORTS_DATA_TYPE readData;
21883  readData = SYS_PORTS_Read( MY_PORTS_INSTANCE, MY_CHANNEL );
21884  </code>
21885  Remarks:
21886  None.
21887 */
21888 
21890  SYS_PORTS_Read (
21891  PORTS_MODULE_ID index ,
21892  PORTS_CHANNEL channel ) ;
21893 // *****************************************************************************
21894 /* Function:
21895  void SYS_PORTS_Write( PORTS_MODULE_ID index,
21896  PORTS_CHANNEL channel,
21897  PORTS_DATA_TYPE value )
21898  Summary:
21899  Writes the data to the I/O port.
21900  <p><b>Implementation:</b> Dynamic</p>
21901  Description:
21902  This function writes the data to the I/O port.
21903  Preconditions:
21904  The direction of the port to be set as output.
21905  Parameters:
21906  index - Identifier for the device instance to be configured
21907  channel - Identifier for the PORT channel: A, B, C, etc.
21908  value - Value to be written into a port of width PORTS_DATA_TYPE
21909  Returns:
21910  None.
21911  Example:
21912  <code>
21913  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21914  // application developer.
21915  PORTS_DATA_TYPE writeData;
21916  SYS_PORTS_Write( MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE );
21917  </code>
21918  Remarks:
21919  None.
21920 */
21921 
21922 void
21923  SYS_PORTS_Write (
21924  PORTS_MODULE_ID index ,
21925  PORTS_CHANNEL channel ,
21926  PORTS_DATA_TYPE value ) ;
21927 // *****************************************************************************
21928 /* Function:
21929  PORTS_DATA_TYPE SYS_PORTS_LatchedGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
21930  Summary:
21931  Reads the data driven on the I/O port.
21932  <p><b>Implementation:</b> Dynamic</p>
21933  Description:
21934  This function reads the data driven on the I/O port.
21935  Preconditions:
21936  The direction of the port to be set as output.
21937  Parameters:
21938  index - Identifier for the device instance to be configured
21939  channel - Identifier for the PORT channel: A, B, C, etc.
21940  Returns:
21941  Returns the data driven on the port.
21942  Example:
21943  <code>
21944  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21945  // application developer.
21946  PORTS_DATA_TYPE drivenData;
21947  drivenData = SYS_PORTS_LatchedGet( MY_PORTS_INSTANCE, MY_CHANNEL );
21948  </code>
21949  Remarks:
21950  None.
21951 */
21952 
21955  PORTS_MODULE_ID index ,
21956  PORTS_CHANNEL channel ) ;
21957 // *****************************************************************************
21958 /* Function:
21959  void SYS_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
21960  PORTS_DATA_TYPE value,
21961  PORTS_DATA_MASK mask )
21962  Summary:
21963  Sets the selected digital port/latch based on the mask.
21964  <p><b>Implementation:</b> Dynamic</p>
21965  Description:
21966  This function Sets the selected digital port/latch relative to the mask.
21967  This function "AND" value and mask parameters and then set the bits
21968  in the port channel that were set in the result of the ANDing operation.
21969  Preconditions:
21970  None.
21971  Parameters:
21972  index - Identifier for the device instance to be configured
21973  channel - Identifier for the PORT channel: A, B, C, etc.
21974  value - Consists of information about which port bit has to be set
21975  mask - Identifies the bits which could be intended for setting
21976  Returns:
21977  None.
21978  Example:
21979  <code>
21980  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21981  // application developer.
21982  // MY_VALUE - 0x1234
21983  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
21984  // Set the MY_CHANNEL bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
21985  SYS_PORTS_Set(MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE, myMask);
21986  </code>
21987  Remarks:
21988  Not all features are available on all devices. Refer to the specific device
21989  data sheet for availability.
21990 */
21991 
21992 void
21993  SYS_PORTS_Set (
21994  PORTS_MODULE_ID index ,
21995  PORTS_CHANNEL channel ,
21996  PORTS_DATA_TYPE value ,
21997  PORTS_DATA_MASK mask ) ;
21998 // *****************************************************************************
21999 /* Function:
22000  void SYS_PORTS_Clear ( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22001  PORTS_DATA_MASK clearMask )
22002  Summary:
22003  Clears the selected digital port.
22004  <p><b>Implementation:</b> Dynamic</p>
22005  Description:
22006  This function clears the selected digital port.
22007  Preconditions:
22008  None.
22009  Parameters:
22010  index - Identifier for the device instance to be configured
22011  channel - Identifier for the PORT channel: A, B, C, etc.
22012  clearMask - Identifies the bits to be cleared
22013  Returns:
22014  None.
22015  Example:
22016  <code>
22017  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22018  // application developer.
22019  PORTS_DATA_MASK clearMask = (PORTS_DATA_MASK)0x00FF;
22020  SYS_PORTS_Clear( MY_PORTS_INSTANCE, MY_CHANNEL, clearMask );
22021  </code>
22022  Remarks:
22023  Not all features are available on all devices. Refer to the specific device
22024  data sheet for availability.
22025 */
22026 
22027 void
22028  SYS_PORTS_Clear (
22029  PORTS_MODULE_ID index ,
22030  PORTS_CHANNEL channel ,
22031  PORTS_DATA_MASK clearMask ) ;
22032 // *****************************************************************************
22033 /* Function:
22034  void SYS_PORTS_DirectionSelect( PORTS_MODULE_ID index,
22035  SYS_PORTS_PIN_DIRECTION pinDir,
22036  PORTS_CHANNEL channel,
22037  PORTS_DATA_MASK mask )
22038  Summary:
22039  Enables the direction for the selected port.
22040  <p><b>Implementation:</b> Dynamic</p>
22041  Description:
22042  This function enables the direction for the selected port.
22043  Preconditions:
22044  None.
22045  Parameters:
22046  index - Identifier for the device instance to be configured
22047  pinDir - Pin direction
22048  channel - Identifier for the PORT channel: A, B, C, etc.
22049  mask - Mask for the direction of width PORTS_DATA_MASK
22050  Returns:
22051  None
22052  Example:
22053  <code>
22054  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22055  // application developer.
22056  SYS_PORTS_PIN_DIRECTION pinDir;
22057  pinDir = SYS_PORTS_DIRECTION_INPUT;
22058  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
22059  SYS_PORTS_DirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, myMask );
22060  </code>
22061  Remarks:
22062  None.
22063 */
22064 
22065 void
22067  PORTS_MODULE_ID index ,
22068  SYS_PORTS_PIN_DIRECTION pinDir ,
22069  PORTS_CHANNEL channel ,
22070  PORTS_DATA_MASK mask ) ;
22071 // *****************************************************************************
22072 /* Function:
22073  PORTS_DATA_MASK SYS_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
22074  Summary:
22075  Reads the direction for the selected port.
22076  <p><b>Implementation:</b> Dynamic</p>
22077  Description:
22078  This function reads the direction for the selected port.
22079  Preconditions:
22080  None.
22081  Parameters:
22082  index - Identifier for the device instance to be configured
22083  channel - Identifier for the PORT channel: A, B, C, etc.
22084  Returns:
22085  Direction of the port.
22086  Example:
22087  <code>
22088  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22089  // application developer.
22090  PORTS_DATA_MASK value;
22091  value = SYS_PORTS_DirectionGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22092  </code>
22093  Remarks:
22094  None.
22095 */
22096 
22099  PORTS_MODULE_ID index ,
22100  PORTS_CHANNEL channel ) ;
22101 // *****************************************************************************
22102 /* Function:
22103  void SYS_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22104  PORTS_DATA_MASK toggleMask )
22105  Summary:
22106  Toggles the selected digital port pins.
22107  <p><b>Implementation:</b> Dynamic</p>
22108  Description:
22109  This function toggles the selected digital port pins.
22110  Preconditions:
22111  None.
22112  Parameters:
22113  index - Identifier for the device instance to be configured
22114  channel - Identifier for the PORT channel: A, B, C, etc.
22115  toggleMask - Identifies the bits to be toggled
22116  Returns:
22117  None.
22118  Example:
22119  <code>
22120  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22121  // application developer.
22122  PORTS_DATA_MASK toggleMask = (PORTS_DATA_MASK)0x00FF;
22123  SYS_PORTS_Toggle( MY_PORTS_INSTANCE, MY_CHANNEL, toggleMask );
22124  </code>
22125  Remarks:
22126  None.
22127 */
22128 
22129 void
22131  PORTS_MODULE_ID index ,
22132  PORTS_CHANNEL channel ,
22133  PORTS_DATA_MASK toggleMask ) ;
22134 // *****************************************************************************
22135 /* Function:
22136  void SYS_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22137  PORTS_DATA_MASK mask )
22138  Summary:
22139  Enables the open-drain functionality for the selected port.
22140  <p><b>Implementation:</b> Dynamic</p>
22141  Description:
22142  This function enables the open-drain functionality for the selected port.
22143  Preconditions:
22144  None.
22145  Parameters:
22146  index - Identifier for the device instance to be configured
22147  channel - Identifier for the PORT channel: A, B, C, etc.
22148  mask - Mask of type PORTS_DATA_MASK
22149  Returns:
22150  None.
22151  Example:
22152  <code>
22153  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22154  // application developer.
22155  SYS_PORTS_OpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22156  </code>
22157  Remarks:
22158  Not all features are available on all devices. Refer to the specific device
22159  data sheet for availability.
22160 */
22161 
22162 void
22164  PORTS_MODULE_ID index ,
22165  PORTS_CHANNEL channel ,
22166  PORTS_DATA_MASK mask ) ;
22167 // *****************************************************************************
22168 /* Function:
22169  void SYS_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22170  PORTS_DATA_MASK mask )
22171  Summary:
22172  Disables the open-drain functionality for the selected port.
22173  <p><b>Implementation:</b> Dynamic</p>
22174  Description:
22175  This function disables the open-drain functionality for the selected port.
22176  Preconditions:
22177  None.
22178  Parameters:
22179  index - Identifier for the device instance to be configured
22180  channel - Identifier for the PORT channel: A, B, C, etc.
22181  mask - Mask of type PORTS_DATA_MASK
22182  Returns:
22183  None.
22184  Example:
22185  <code>
22186  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22187  // application developer.
22188  SYS_PORTS_PeripheralOpenDrainDisable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22189  </code>
22190  Remarks:
22191  Not all features are available on all devices. Refer to the specific device
22192  data sheet for availability.
22193 */
22194 
22195 void
22197  PORTS_MODULE_ID index ,
22198  PORTS_CHANNEL channel ,
22199  PORTS_DATA_MASK mask ) ;
22200 // *****************************************************************************
22201 /* Function:
22202  PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet
22203  (
22204  PORTS_MODULE_ID index,
22205  PORTS_CHANNEL channel
22206  )
22207  Summary:
22208  Reads the interrupt status from the I/O port.
22209  <p><b>Implementation:</b> Dynamic</p>
22210  Description:
22211  This function reads the interrupt status from the I/O port.
22212  Preconditions:
22213  The interrupts should have been configured.
22214  Parameters:
22215  index - Identifier for the device instance to be configured
22216  channel - Identifier for the PORT channel: A, B, C, etc.
22217  Returns:
22218  Returns the interrupt status of the port channel.
22219  Example:
22220  <code>
22221  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22222  // application developer.
22223  PORTS_DATA_TYPE channelStatus;
22224  channelStatus = SYS_PORTS_InterruptStatusGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22225  </code>
22226  Remarks:
22227  None.
22228 */
22229 
22232  PORTS_MODULE_ID index ,
22233  PORTS_CHANNEL channel ) ;
22234 // *****************************************************************************
22235 // *****************************************************************************
22236 // Section: SYS PORT PINS REMAPING Routines
22237 // *****************************************************************************
22238 // *****************************************************************************
22239 // *****************************************************************************
22240 /* Function:
22241  void SYS_PORTS_RemapInput( PORTS_MODULE_ID index,
22242  PORTS_REMAP_INPUT_FUNCTION function,
22243  PORTS_REMAP_INPUT_PIN remapPin )
22244  Summary:
22245  Input/Output (I/O) function remapping.
22246  <p><b>Implementation:</b> Dynamic</p>
22247  Description:
22248  This function controls the I/O function remapping.
22249  Precondition:
22250  None.
22251  Parameters:
22252  index - Identifier for the device instance to be configured
22253  function - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
22254  remapPin - One of the possible values of PORTS_REMAP_INPUT_PIN
22255  Returns:
22256  None.
22257  Example:
22258  <code>
22259  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22260  // application developer.
22261  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
22262  SYS_PORTS_RemapInput(MY_PORTS_INSTANCE, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
22263  </code>
22264  Remarks:
22265  This feature may not be available on all devices. Please refer to the
22266  specific device data sheet to determine availability or use
22267  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22268  this feature is available.
22269 */
22270 
22271 void
22273  PORTS_MODULE_ID index ,
22274  PORTS_REMAP_INPUT_FUNCTION function ,
22275  PORTS_REMAP_INPUT_PIN remapPin ) ;
22276 // *****************************************************************************
22277 /* Function:
22278  void SYS_PORTS_RemapOutput( PORTS_MODULE_ID index,
22279  PORTS_REMAP_OUTPUT_FUNCTION function,
22280  PORTS_REMAP_OUTPUT_PIN remapPin )
22281  Summary:
22282  Input/Output (I/O) function remapping.
22283  <p><b>Implementation:</b> Dynamic</p>
22284  Description:
22285  This function controls the I/O function remapping.
22286  Precondition:
22287  None.
22288  Parameters:
22289  index - Identifier for the device instance to be configured
22290  function - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
22291  remapPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
22292  Returns:
22293  None.
22294  Example:
22295  <code>
22296  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22297  // application developer.
22298  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
22299  SYS_PORTS_RemapInputOutput(MY_PORTS_INSTANCE, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
22300  </code>
22301  Remarks:
22302  This feature may not be available on all devices. Please refer to the
22303  specific device data sheet to determine availability or use
22304  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22305  this feature is available.
22306 */
22307 
22308 void
22310  PORTS_MODULE_ID index ,
22311  PORTS_REMAP_OUTPUT_FUNCTION function ,
22312  PORTS_REMAP_OUTPUT_PIN remapPin ) ;
22313 // *****************************************************************************
22314 // *****************************************************************************
22315 // Section: SYS Change Notification Pins Routines
22316 // *****************************************************************************
22317 // *****************************************************************************
22318 // *****************************************************************************
22319 /* Function:
22320  void SYS_PORTS_ChangeNotificationGlobalEnable( PORTS_MODULE_ID index )
22321  Summary:
22322  Globally enables the change notification for the selected port.
22323  <p><b>Implementation:</b> Dynamic</p>
22324  Description:
22325  This function globally enables the change notification for the selected port.
22326  Preconditions:
22327  None.
22328  Parameters:
22329  None.
22330  Returns:
22331  None.
22332  Example:
22333  <code>
22334  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22335  // application developer.
22336  SYS_PORTS_ChangeNotificationGlobalEnable( MY_PORTS_INSTANCE );
22337  </code>
22338  Remarks:
22339  Not all features are available on all devices. Refer to the specific device
22340  data sheet for availability.
22341 */
22342 
22343 void
22345  PORTS_MODULE_ID index ) ;
22346 // *****************************************************************************
22347 /* Function:
22348  void SYS_PORTS_ChangeNotificationGlobalDisable( PORTS_MODULE_ID index );
22349  Summary:
22350  Globally disables the change notification for the selected port.
22351  <p><b>Implementation:</b> Dynamic</p>
22352  Description:
22353  This function globally disables the change notification for the selected port.
22354  Preconditions:
22355  None.
22356  Parameters:
22357  None.
22358  Returns:
22359  None.
22360  Example:
22361  <code>
22362  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22363  // application developer.
22364  SYS_PORTS_ChangeNotificationGlobalDisable( MY_PORTS_INSTANCE);
22365  </code>
22366  Remarks:
22367  Not all features are available on all devices. Refer to the specific device
22368  data sheet for availability.
22369 */
22370 
22371 void
22373  PORTS_MODULE_ID index ) ;
22374 // *****************************************************************************
22375 /* Function:
22376  void SYS_PORTS_ChangeNotificationEnable( PORTS_MODULE_ID index,
22377  PORTS_CHANGE_NOTICE_PIN pinNum,
22378  SYS_PORTS_PULLUP_PULLDOWN_STATUS value )
22379  Summary:
22380  Enables the change notification for the selected port.
22381  <p><b>Implementation:</b> Dynamic</p>
22382  Description:
22383  This function enables the change notification for the selected port.
22384  Preconditions:
22385  None.
22386  Parameters:
22387  index - Identifier for the device instance to be configured
22388  value - Pull-up enable or disable value
22389  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22390  Returns:
22391  None.
22392  Example:
22393  <code>
22394  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22395  // application developer.
22396  SYS_PORTS_PULLUP_PULLDOWN_STATUS value;
22397  PORTS_CHANGE_NOTICE_PIN pinNum;
22398  SYS_PORTS_ChangeNotificationEnable( index, pinNum, value );
22399  </code>
22400  Remarks:
22401  Not all features are available on all devices. Refer to the specific device
22402  data sheet for availability.
22403 */
22404 
22405 void
22407  PORTS_MODULE_ID index ,
22408  PORTS_CHANGE_NOTICE_PIN pinNum ,
22410 // *****************************************************************************
22411 /* Function:
22412  void SYS_PORTS_ChangeNotificationDisable( PORTS_MODULE_ID index,
22413  PORTS_CHANGE_NOTICE_PIN pinNum )
22414  Summary:
22415  Disables the change notification for the selected port.
22416  <p><b>Implementation:</b> Dynamic</p>
22417  Description:
22418  This function disables the change notification for the selected port.
22419  Preconditions:
22420  None.
22421  Parameters:
22422  index - Identifier for the device instance to be configured
22423  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22424  Returns:
22425  None.
22426  Example:
22427  <code>
22428  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22429  // application developer.
22430  PORTS_CHANGE_NOTICE_PIN pinNum;
22431  SYS_PORTS_ChangeNotificationDisable( index, pinNum );
22432  </code>
22433  Remarks:
22434  Not all features are available on all devices. Refer to the specific device
22435  data sheet for availability.
22436 */
22437 
22438 void
22440  PORTS_MODULE_ID index ,
22441  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22442 // *****************************************************************************
22443 /* Function:
22444  void SYS_PORTS_ChangeNotificationInIdleModeEnable( PORTS_MODULE_ID index );
22445  Summary:
22446  Enables the change notification for the selected port in Sleep or Idle mode.
22447  <p><b>Implementation:</b> Dynamic</p>
22448  Description:
22449  This function enables the change notification for the selected port in Sleep
22450  or Idle mode.
22451  Preconditions:
22452  None.
22453  Parameters:
22454  None.
22455  Returns:
22456  None.
22457  Example:
22458  <code>
22459  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22460  // application developer.
22461  SYS_PORTS_ChangeNotificationInIdleModeEnable( MY_PORTS_INSTANCE );
22462  </code>
22463  Remarks:
22464  Not all features are available on all devices. Refer to the specific device
22465  data sheet for availability.
22466 */
22467 
22468 void
22470  PORTS_MODULE_ID index ) ;
22471 // *****************************************************************************
22472 /* Function:
22473  void SYS_PORTS_ChangeNotificationInIdleModeDisable( PORTS_MODULE_ID index);
22474  Summary:
22475  Disables the change notification for the selected port in Sleep or Idle mode.
22476  <p><b>Implementation:</b> Dynamic</p>
22477  Description:
22478  This function disables the change notification for the selected port in Sleep
22479  or Idle mode.
22480  Preconditions:
22481  None.
22482  Parameters:
22483  None.
22484  Returns:
22485  None.
22486  Example:
22487  <code>
22488  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22489  // application developer.
22490  SYS_PORTS_ChangeNotificationInIdleModeDisable( MY_PORTS_INSTANCE );
22491  </code>
22492  Remarks:
22493  Not all features are available on all devices. Refer to the specific device
22494  data sheet for availability.
22495 */
22496 
22497 void
22499  PORTS_MODULE_ID index ) ;
22500 // *****************************************************************************
22501 /* Function:
22502  void SYS_PORTS_ChangeNotificationPullUpEnable ( PORTS_MODULE_ID index,
22503  PORTS_CHANGE_NOTICE_PIN pinNum )
22504  Summary:
22505  Enables a weak pull-up on the change notification pin.
22506  <p><b>Implementation:</b> Dynamic</p>
22507  Description:
22508  This function enables a weak pull-up on the change notification pin.
22509  Preconditions:
22510  None.
22511  Parameters:
22512  index - Identifier for the device instance to be configured
22513  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22514  Returns:
22515  None.
22516  Example:
22517  <code>
22518  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22519  // application developer.
22520  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22521  SYS_PORTS_ChangeNotificationPullUpEnable( MY_PORTS_INSTANCE, MY_PINNUM );
22522  </code>
22523  Remarks:
22524  Not all features are available on all devices. Refer to the specific device
22525  data sheet for availability.
22526 */
22527 
22528 void
22530  PORTS_MODULE_ID index ,
22531  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22532 // *****************************************************************************
22533 /* Function:
22534  void SYS_PORTS_ChangeNotificationPullUpDisable ( PORTS_MODULE_ID index,
22535  PORTS_CHANGE_NOTICE_PIN pinNum )
22536  Summary:
22537  Disables a weak pull-up on the change notification pin.
22538  <p><b>Implementation:</b> Dynamic</p>
22539  Description:
22540  This function Disables a weak pull-up on the change notification pin.
22541  Preconditions:
22542  None.
22543  Parameters:
22544  index - Identifier for the device instance to be configured
22545  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22546  Returns:
22547  None.
22548  Example:
22549  <code>
22550  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22551  // application developer.
22552  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22553  SYS_PORTS_ChangeNotificationPullUpDisable( MY_PORTS_INSTANCE, MY_PINNUM );
22554  </code>
22555  Remarks:
22556  Not all features are available on all devices. Refer to the specific device
22557  data sheet for availability.
22558 */
22559 
22560 void
22562  PORTS_MODULE_ID index ,
22563  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22564 // *****************************************************************************
22565 // *****************************************************************************
22566 // Section: SYS PORT PINS Control Routines
22567 // *****************************************************************************
22568 // *****************************************************************************
22569 // *****************************************************************************
22570 /* Function:
22571  void SYS_PORTS_PinModeSelect ( PORTS_MODULE_ID index,
22572  PORTS_ANALOG_PIN pin,
22573  PORTS_PIN_MODE mode)
22574  Summary:
22575  Enables the selected pin as analog or digital.
22576  <p><b>Implementation:</b> Dynamic</p>
22577  Description:
22578  This function enables the selected pin as analog or digital.
22579  Preconditions:
22580  None.
22581  Parameters:
22582  index - Identifier for the device instance to be configured
22583  pin - Possible values of PORTS_ANALOG_PIN
22584  mode - Possible values of PORTS_PIN_MODE
22585  Returns:
22586  None.
22587  Example:
22588  <code>
22589  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22590  // application developer.
22591  // MY_PIN - PORTS_ANALOG_PIN_AN0
22592  // MY_PIN_MODE - PORTS_PIN_MODE_ANALOG
22593  SYS_PORTS_PinModSYS_PORTS_PinModeSelecteSelect( MY_PORTS_INSTANCE, MY_PIN, MY_PIN_MODE );
22594  </code>
22595  Remarks:
22596  Not all features are available on all devices. Refer to the specific device
22597  data sheet for availability.
22598 */
22599 
22600 void
22602  PORTS_MODULE_ID index ,
22603  PORTS_ANALOG_PIN pin ,
22604  PORTS_PIN_MODE mode ) ;
22605 // *****************************************************************************
22606 /* Function:
22607  void SYS_PORTS_PinWrite ( PORTS_MODULE_ID index,
22608  PORTS_CHANNEL channel,
22609  PORTS_BIT_POS bitPos
22610  bool value )
22611  Summary:
22612  Writes the selected digital pin.
22613  <p><b>Implementation:</b> Dynamic</p>
22614  Description:
22615  This function writes the selected digital pin.
22616  Preconditions:
22617  None.
22618  Parameters:
22619  index - Identifier for the device instance to be configured
22620  channel - Identifier for the PORT channel: A, B, C, etc.
22621  bitPos - Possible values of PORTS_BIT_POS
22622  value - Value to be written to the specific pin/latch:
22623  - true - Sets the bit
22624  - false - Clears the bit
22625  Returns:
22626  None.
22627  Example:
22628  <code>
22629  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22630  // application developer.
22631  // MY_PINNUM - PORTS_PIN_10
22632  SYS_PORTS_PinWrite(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM, value);
22633  </code>
22634  Remarks:
22635  Not all features are available on all devices. Refer to the specific device
22636  data sheet for availability.
22637 */
22638 
22639 void
22641  PORTS_MODULE_ID index ,
22642  PORTS_CHANNEL channel ,
22643  PORTS_BIT_POS bitPos ,
22644  bool value ) ;
22645 // *****************************************************************************
22646 /* Function:
22647  bool SYS_PORTS_PinLatchedGet ( PORTS_MODULE_ID index,
22648  PORTS_CHANNEL channel,
22649  PORTS_BIT_POS bitPos )
22650  Summary:
22651  Reads the data driven on the selected digital pin.
22652  <p><b>Implementation:</b> Dynamic</p>
22653  Description:
22654  This function reads the data driven on the selected
22655  digital output pin.
22656  Preconditions:
22657  None.
22658  Parameters:
22659  index - Identifier for the device instance to be configured
22660  channel - Identifier for the PORT channel: A, B, C, etc.
22661  bitPos - Possible values of PORTS_BIT_POS
22662  Returns:
22663  The status of the data driven on the port pin.
22664  Example:
22665  <code>
22666  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22667  // application developer.
22668  // MY_PINNUM - PORTS_PIN_10
22669  status = SYS_PORTS_PinLatchedGet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22670  </code>
22671  Remarks:
22672  Not all features are available on all devices. Refer to the specific device
22673  data sheet for availability.
22674 */
22675 
22676 bool
22678  PORTS_MODULE_ID index ,
22679  PORTS_CHANNEL channel ,
22680  PORTS_BIT_POS bitPos ) ;
22681 // *****************************************************************************
22682 /* Function:
22683  bool SYS_PORTS_PinRead ( PORTS_MODULE_ID index,
22684  PORTS_CHANNEL channel,
22685  PORTS_BIT_POS bitPos )
22686  Summary:
22687  Reads the selected digital pin.
22688  <p><b>Implementation:</b> Dynamic</p>
22689  Description:
22690  This function reads the selected digital pin, not the Latch.
22691  Preconditions:
22692  None.
22693  Parameters:
22694  index - Identifier for the device instance to be configured
22695  channel - Identifier for the PORT channel: A, B, C, etc.
22696  bitPos - Possible values of PORTS_BIT_POS
22697  Returns:
22698  The status of the port pin.
22699  Example:
22700  <code>
22701  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22702  // application developer.
22703  // MY_PINNUM - PORTS_PIN_10
22704  bool bitStatus = SYS_PORTS_PinRead(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22705  </code>
22706  Remarks:
22707  Not all features are available on all devices. Refer to the specific device
22708  data sheet for availability.
22709 */
22710 
22711 bool
22713  PORTS_MODULE_ID index ,
22714  PORTS_CHANNEL channel ,
22715  PORTS_BIT_POS bitPos ) ;
22716 // *****************************************************************************
22717 /* Function:
22718  void SYS_PORTS_PinToggle ( PORTS_MODULE_ID index,
22719  PORTS_CHANNEL channel,
22720  PORTS_BIT_POS bitPos )
22721  Summary:
22722  Toggles the selected digital pin.
22723  <p><b>Implementation:</b> Dynamic</p>
22724  Description:
22725  This function toggles the selected digital pin.
22726  Preconditions:
22727  None.
22728  Parameters:
22729  index - Identifier for the device instance to be configured
22730  channel - Identifier for the PORT channel: A, B, C, etc.
22731  bitPos - Possible values of PORTS_BIT_POS
22732  Returns:
22733  None.
22734  Example:
22735  <code>
22736  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22737  // application developer.
22738  // MY_PINNUM - PORTS_PIN_10
22739  SYS_PORTS_PinToggle( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22740  </code>
22741  Remarks:
22742  Not all features are available on all devices. Refer to the specific device
22743  data sheet for availability.
22744 */
22745 
22746 void
22748  PORTS_MODULE_ID index ,
22749  PORTS_CHANNEL channel ,
22750  PORTS_BIT_POS bitPos ) ;
22751 // *****************************************************************************
22752 /* Function:
22753  void SYS_PORTS_PinSet( PORTS_MODULE_ID index,
22754  PORTS_CHANNEL channel,
22755  PORTS_BIT_POS bitPos )
22756  Summary:
22757  Sets the selected digital pin/latch.
22758  <p><b>Implementation:</b> Dynamic</p>
22759  Description:
22760  This function sets the selected digital pin/latch.
22761  Preconditions:
22762  None.
22763  Parameters:
22764  index - Identifier for the device instance to be configured
22765  channel - Identifier for the PORT channel: A, B, C, etc.
22766  bitPos - Possible values of PORTS_BIT_POS
22767  Returns:
22768  None.
22769  Example:
22770  <code>
22771  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22772  // application developer.
22773  // MY_PINNUM - PORTS_PIN_10
22774  SYS_PORTS_PinSet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22775  </code>
22776  Remarks:
22777  Not all features are available on all devices. Refer to the specific device
22778  data sheet for availability.
22779 */
22780 
22781 void
22783  PORTS_MODULE_ID index ,
22784  PORTS_CHANNEL channel ,
22785  PORTS_BIT_POS bitPos ) ;
22786 // *****************************************************************************
22787 /* Function:
22788  void SYS_PORTS_PinClear ( PORTS_MODULE_ID index,
22789  PORTS_CHANNEL channel,
22790  PORTS_BIT_POS bitPos )
22791  Summary:
22792  Clears the selected digital pin.
22793  <p><b>Implementation:</b> Dynamic</p>
22794  Description:
22795  This function clears the selected digital pin.
22796  Preconditions:
22797  None.
22798  Parameters:
22799  index - Identifier for the device instance to be configured
22800  channel - Identifier for the PORT channel: A, B, C, etc.
22801  bitPos - Possible values of PORTS_BIT_POS
22802  Returns:
22803  None.
22804  Example:
22805  <code>
22806  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22807  // application developer.
22808  // MY_PINNUM - PORTS_IO_PIN_10
22809  SYS_PORTS_PinClear( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22810  </code>
22811  Remarks:
22812  Not all features are available on all devices. Refer to the specific device
22813  data sheet for availability.
22814 */
22815 
22816 void
22818  PORTS_MODULE_ID index ,
22819  PORTS_CHANNEL channel ,
22820  PORTS_BIT_POS bitPos ) ;
22821 // *****************************************************************************
22822 /* Function:
22823  void SYS_PORTS_PinDirectionSelect ( PORTS_MODULE_ID index,
22824  SYS_PORTS_PIN_DIRECTION pinDir,
22825  PORTS_CHANNEL channel,
22826  PORTS_BIT_POS bitPos )
22827  Summary:
22828  Enables the direction for the selected pin.
22829  <p><b>Implementation:</b> Dynamic</p>
22830  Description:
22831  This function enables the direction for the selected pin.
22832  Preconditions:
22833  None.
22834  Parameters:
22835  index - Identifier for the device instance to be configured
22836  pinDir - Pin direction
22837  channel - Identifier for the PORT channel: A, B, C, etc.
22838  bitPos - Possible values of PORTS_BIT_POS
22839  Returns:
22840  None.
22841  Example:
22842  <code>
22843  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22844  // application developer.
22845  // MY_PINNUM - PORTS_PIN_10
22846  SYS_PORTS_PIN_DIRECTION pinDir;
22847  pinDir = SYS_PORTS_DIRECTION_INPUT;
22848  SYS_PORTS_PinDirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, MY_PINNUM);
22849  </code>
22850  Remarks:
22851  Not all features are available on all devices. Refer to the specific device
22852  data sheet for availability.
22853 */
22854 
22855 void
22857  PORTS_MODULE_ID index ,
22858  SYS_PORTS_PIN_DIRECTION pinDir ,
22859  PORTS_CHANNEL channel ,
22860  PORTS_BIT_POS bitPos ) ;
22861 // *****************************************************************************
22862 /* Function:
22863  void SYS_PORTS_PinOpenDrainEnable ( PORTS_MODULE_ID index,
22864  PORTS_CHANNEL channel,
22865  PORTS_BIT_POS bitPos )
22866  Summary:
22867  Enables the open-drain functionality for the selected pin.
22868  <p><b>Implementation:</b> Dynamic</p>
22869  Description:
22870  This function enables the open-drain functionality for the selected pin.
22871  Preconditions:
22872  None.
22873  Parameters:
22874  index - Identifier for the device instance to be configured
22875  channel - Identifier for the PORT channel: A, B, C, etc.
22876  bitPos - Possible values of PORTS_BIT_POS
22877  Returns:
22878  None.
22879  Example:
22880  <code>
22881  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22882  // application developer.
22883  // MY_PINNUM - PORTS_PIN_10
22884  SYS_PORTS_PinOpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22885  </code>
22886  Remarks:
22887  Not all features are available on all devices. Refer to the specific device
22888  data sheet for availability.
22889 */
22890 
22891 void
22893  PORTS_MODULE_ID index ,
22894  PORTS_CHANNEL channel ,
22895  PORTS_BIT_POS bitPos ) ;
22896 // *****************************************************************************
22897 /* Function:
22898  void SYS_PORTS_PinOpenDrainDisable ( PORTS_MODULE_ID index,
22899  PORTS_CHANNEL channel,
22900  PORTS_BIT_POS bitPos )
22901  Summary:
22902  Disables the open-drain functionality for the selected pin.
22903  <p><b>Implementation:</b> Dynamic</p>
22904  Description:
22905  This function disables the open-drain functionality for the selected pin.
22906  Preconditions:
22907  None.
22908  Parameters:
22909  index - Identifier for the device instance to be configured
22910  channel - Identifier for the PORT channel: A, B, C, etc.
22911  bitPos - Possible values of PORTS_BIT_POS
22912  Returns:
22913  None.
22914  Example:
22915  <code>
22916  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22917  // application developer.
22918  // MY_PINNUM - PORTS_PIN_10
22919  SYS_PORTS_PinOpenDrainDisable(MY_PORTS_INSTANCE, MY_PINNUM);
22920  </code>
22921  Remarks:
22922  Not all features are available on all devices. Refer to the specific device
22923  data sheet for availability.
22924 */
22925 
22926 void
22928  PORTS_MODULE_ID index ,
22929  PORTS_CHANNEL channel ,
22930  PORTS_BIT_POS bitPos ) ;
22931 // *****************************************************************************
22932 /* Function:
22933  void SYS_PORTS_PinPullUpEnable ( PORTS_MODULE_ID index,
22934  PORTS_CHANNEL channel,
22935  PORTS_BIT_POS bitPos )
22936  Summary:
22937  Enables the pull-up functionality for the selected pin.
22938  <p><b>Implementation:</b> Dynamic</p>
22939  Description:
22940  This function enables the pull-up functionality for the selected pin.
22941  Preconditions:
22942  None.
22943  Parameters:
22944  index - Identifier for the device instance to be configured
22945  channel - Identifier for the PORT channel: A, B, C, etc.
22946  bitPos - Possible values of PORTS_BIT_POS
22947  Returns:
22948  None.
22949  Example:
22950  <code>
22951  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22952  // application developer.
22953  // MY_PINNUM - PORTS_PIN_10
22954  SYS_PORTS_PinPullUpEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22955  </code>
22956  Remarks:
22957  Not all features are available on all devices. Refer to the specific device
22958  data sheet for availability.
22959 */
22960 
22961 void
22963  PORTS_MODULE_ID index ,
22964  PORTS_CHANNEL channel ,
22965  PORTS_BIT_POS bitPos ) ;
22966 // *****************************************************************************
22967 /* Function:
22968  void SYS_PORTS_PinPullUpDisable ( PORTS_MODULE_ID index,
22969  PORTS_CHANNEL channel,
22970  PORTS_BIT_POS bitPos )
22971  Summary:
22972  Disables the pull-up functionality for the selected pin.
22973  <p><b>Implementation:</b> Dynamic</p>
22974  Description:
22975  This function disables the pull-up functionality for the selected pin.
22976  Preconditions:
22977  None.
22978  Parameters:
22979  index - Identifier for the device instance to be configured
22980  channel - Identifier for the PORT channel: A, B, C, etc.
22981  bitPos - Possible values of PORTS_BIT_POS
22982  Returns:
22983  None.
22984  Example:
22985  <code>
22986  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22987  // application developer.
22988  // MY_PINNUM - PORTS_PIN_10
22989  SYS_PORTS_PinPullUpDisable(MY_PORTS_INSTANCE, MY_PINNUM);
22990  </code>
22991  Remarks:
22992  Not all features are available on all devices. Refer to the specific device
22993  data sheet for availability.
22994 */
22995 
22996 void
22998  PORTS_MODULE_ID index ,
22999  PORTS_CHANNEL channel ,
23000  PORTS_BIT_POS bitPos ) ;
23001 // *****************************************************************************
23002 /* Function:
23003  void SYS_PORTS_PinPullDownEnable ( PORTS_MODULE_ID index,
23004  PORTS_CHANNEL channel,
23005  PORTS_BIT_POS bitPos )
23006  Summary:
23007  Enables the pull-down functionality for the selected pin.
23008  <p><b>Implementation:</b> Dynamic</p>
23009  Description:
23010  This function enables the pull-down functionality for the selected pin.
23011  Preconditions:
23012  None.
23013  Parameters:
23014  index - Identifier for the device instance to be configured
23015  channel - Identifier for the PORT channel: A, B, C, etc.
23016  bitPos - Possible values of PORTS_BIT_POS
23017  Returns:
23018  None.
23019  Example:
23020  <code>
23021  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23022  // application developer.
23023  // MY_PINNUM - PORTS_PIN_10
23024  SYS_PORTS_PinPullDownEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23025  </code>
23026  Remarks:
23027  Not all features are available on all devices. Refer to the specific device
23028  data sheet for availability.
23029 */
23030 
23031 void
23033  PORTS_MODULE_ID index ,
23034  PORTS_CHANNEL channel ,
23035  PORTS_BIT_POS bitPos ) ;
23036 // *****************************************************************************
23037 /* Function:
23038  void SYS_PORTS_PinPullDownDisable ( PORTS_MODULE_ID index,
23039  PORTS_CHANNEL channel,
23040  PORTS_BIT_POS bitPos )
23041  Summary:
23042  Disables the pull-down functionality for the selected pin.
23043  <p><b>Implementation:</b> Dynamic</p>
23044  Description:
23045  This function disables the pull-down functionality for the selected pin.
23046  Preconditions:
23047  None.
23048  Parameters:
23049  index - Identifier for the device instance to be configured
23050  channel - Identifier for the PORT channel: A, B, C, etc.
23051  bitPos - Possible values of PORTS_BIT_POS
23052  Returns:
23053  None.
23054  Example:
23055  <code>
23056  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23057  // application developer.
23058  // MY_PINNUM - PORTS_PIN_10
23059  SYS_PORTS_PinPullDownDisable(MY_PORTS_INSTANCE, MY_PINNUM);
23060  </code>
23061  Remarks:
23062  Not all features are available on all devices. Refer to the specific device
23063  data sheet for availability.
23064 */
23065 
23066 void
23068  PORTS_MODULE_ID index ,
23069  PORTS_CHANNEL channel ,
23070  PORTS_BIT_POS bitPos ) ;
23071 //******************************************************************************
23072 /* Function:
23073  void SYS_PORTS_InterruptEnable
23074  (
23075  PORTS_MODULE_ID index,
23076  PORTS_CHANNEL channel,
23077  PORTS_BIT_POS bitPos,
23078  PORTS_PIN_INTERRUPT_TYPE pinInterruptType
23079  )
23080  Summary:
23081  Enables the selected interrupt for the selected port pin.
23082  Description:
23083  This function enables the selected interrupt for the selected port pin.
23084  Preconditions:
23085  Select the pull-up or pull-down as required.
23086  Parameters:
23087  index - Identifier for the device instance to be configured
23088  channel - Identifier for the PORT channel: A, B, C, etc.
23089  bitPos - Possible values of PORTS_BIT_POS
23090  pinInterruptType - Interrupt type from PORTS_PIN_INTERRUPT_TYPE set
23091  Returns:
23092  None.
23093  Example:
23094  <code>
23095  SYS_PORTS_InterruptEnable(MY_PORTS_INSTANCE, MY_PORTS_CHANNEL, MY_PORT_BIT_POS, PORTS_PIN_INTERRUPT_BOTH_EDGE );
23096  </code>
23097  Remarks:
23098  None.
23099 */
23100 
23101 void
23103  PORTS_MODULE_ID index ,
23104  PORTS_CHANNEL channel ,
23105  PORTS_BIT_POS bitPos ,
23106  PORTS_PIN_INTERRUPT_TYPE pinInterruptType ) ;
23107 //DOM-IGNORE-BEGIN
23108 //DOM-IGNORE-END
23109  //SYS_PORTS_H
23110 /*******************************************************************************
23111  End of File
23112 */
23113 
23114 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h*/
23115 /* CLOSE_FILE Include File */
23116 
23117 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h */
23118 /*******************************************************************************
23119  SPI Driver Interface
23120  Company:
23121  Microchip Technology Inc.
23122  File Name:
23123  drv_spi.h
23124  Summary:
23125  SPI device driver interface file.
23126  Description:
23127  The SPI driver provides a simple interface to manage the SPI module.
23128  This file defines the interface definitions and prototypes for the SPI driver.
23129 *******************************************************************************/
23130 //DOM-IGNORE-BEGIN
23131 /*******************************************************************************
23132 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
23133 Microchip licenses to you the right to use, modify, copy and distribute
23134 Software only when embedded on a Microchip microcontroller or digital signal
23135 controller that is integrated into your product or third party product
23136 (pursuant to the sublicense terms in the accompanying license agreement).
23137 You should refer to the license agreement accompanying this Software for
23138 additional information regarding your rights and obligations.
23139 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23140 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23141 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23142 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23143 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23144 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23145 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23146 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23147 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23148 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23149 *******************************************************************************/
23150 //DOM-IGNORE-END
23151 #ifndef _DRV_SPI_H
23152 #define _DRV_SPI_H
23153 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h */
23154 /*******************************************************************************
23155  SPI Driver Interface
23156  Company:
23157  Microchip Technology Inc.
23158  File Name:
23159  drv_spi_definitions.h
23160  Summary:
23161  SPI device driver interface file.
23162  Description:
23163  The SPI driver provides a simple interface to manage the SPI module.
23164  This file defines the interface definitions and prototypes for the SPI
23165  driver.
23166 *******************************************************************************/
23167 //DOM-IGNORE-BEGIN
23168 /*******************************************************************************
23169 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
23170 Microchip licenses to you the right to use, modify, copy and distribute
23171 Software only when embedded on a Microchip microcontroller or digital signal
23172 controller that is integrated into your product or third party product
23173 (pursuant to the sublicense terms in the accompanying license agreement).
23174 You should refer to the license agreement accompanying this Software for
23175 additional information regarding your rights and obligations.
23176 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23177 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23178 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23179 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23180 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23181 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23182 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23183 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23184 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23185 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23186 *******************************************************************************/
23187 //DOM-IGNORE-END
23188 #ifndef _DRV_SPI_DEFINITIONS_H
23189 #define _DRV_SPI_DEFINITIONS_H
23190 // *****************************************************************************
23191 // *****************************************************************************
23192 // Section: Data Types
23193 // *****************************************************************************
23194 // *****************************************************************************
23195 #include <stdint.h>
23196 #include <stdbool.h>
23197 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
23198 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" // Common Driver Definitions /* LDRA full path */
23199 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h */
23200 /*******************************************************************************
23201  SPI Peripheral Library Interface Header
23202  Company:
23203  Microchip Technology Inc.
23204  File Name:
23205  plib_spi.h
23206  Summary:
23207  SPI Peripheral Library Interface Header for common definitions.
23208  Description:
23209  This header file contains the function prototypes and definitions of
23210  the data types and constants that make up the interface to the SPI
23211  PLIB.
23212  *******************************************************************************/
23213 // DOM-IGNORE-BEGIN
23214 /*******************************************************************************
23215 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
23216 Microchip licenses to you the right to use, modify, copy and distribute
23217 Software only when embedded on a Microchip microcontroller or digital signal
23218 controller that is integrated into your product or third party product
23219 (pursuant to the sublicense terms in the accompanying license agreement).
23220 You should refer to the license agreement accompanying this Software for
23221 additional information regarding your rights and obligations.
23222 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23223 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23224 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23225 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23226 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23227 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23228 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23229 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23230 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23231 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23232  *******************************************************************************/
23233 // DOM-IGNORE-END
23234 #ifndef _PLIB_SPI_H
23235 #define _PLIB_SPI_H
23236 // DOM-IGNORE-BEGIN
23237 // DOM-IGNORE-END
23238 // *****************************************************************************
23239 // *****************************************************************************
23240 // Section: Included Files (continued at end of file)
23241 // *****************************************************************************
23242 // *****************************************************************************
23243 /* This section lists the other files that are included in this file. However,
23244  please see the end of the file for additional implementation header files
23245  that are also included.
23246  */
23247 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h */
23248 //DOM-IGNORE-BEGIN
23249 /*******************************************************************************
23250 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
23251 Microchip licenses to you the right to use, modify, copy and distribute
23252 Software only when embedded on a Microchip microcontroller or digital signal
23253 controller that is integrated into your product or third party product
23254 (pursuant to the sublicense terms in the accompanying license agreement).
23255 You should refer to the license agreement accompanying this Software for
23256 additional information regarding your rights and obligations.
23257 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
23258 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23259 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23260 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23261 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23262 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23263 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23264 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23265 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23266 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23267  *******************************************************************************/
23268 //DOM-IGNORE-END
23269 #ifndef _PLIB_SPI_PROCESSOR_H
23270 #define _PLIB_SPI_PROCESSOR_H
23271 #error "Can't find header"
23272 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h*/
23273 /* CLOSE_FILE Include File */
23274 
23275 // *****************************************************************************
23276 // *****************************************************************************
23277 // Section: Constants & Data Types
23278 // *****************************************************************************
23279 // *****************************************************************************
23280 // *****************************************************************************
23281 // *****************************************************************************
23282 // Section: SPI Peripheral Library Interface Routines
23283 // *****************************************************************************
23284 // *****************************************************************************
23285 //******************************************************************************
23286 /* Function:
23287  void PLIB_SPI_Enable( SPI_MODULE_ID index )
23288  Summary:
23289  Enables the SPI module.
23290  Description:
23291  This function enables the SPI module.
23292  This operation is atomic.
23293  Precondition:
23294  None.
23295  Parameters:
23296  index - Identifier for the device instance to be configured
23297  Returns:
23298  None.
23299  Example:
23300  <code>
23301  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23302  // application developer.
23303  PLIB_SPI_Enable(MY_SPI_INSTANCE);
23304  </code>
23305  Remarks:
23306  The SCKx, SDOx, SDIx and SSx pins must be assigned to available RPn pins
23307  before use.
23308  This function implements an operation of the enable control feature. This
23309  feature may not be available on all devices. Please refer to the specific
23310  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23311  in your application to automatically determine whether this feature is available.
23312  */
23313 
23314 void
23315  PLIB_SPI_Enable (
23316  SPI_MODULE_ID index ) ;
23317 //******************************************************************************
23318 /* Function:
23319  void PLIB_SPI_Disable (SPI_MODULE_ID index)
23320  Summary:
23321  Disables the SPI module.
23322  Description:
23323  This function disables the SPI module.
23324  This operation is atomic.
23325  Precondition:
23326  None.
23327  Parameters:
23328  index - Identifier for the device instance to be configured
23329  Returns:
23330  None.
23331  Example:
23332  <code>
23333  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23334  // application developer.
23335  PLIB_SPI_Disable(MY_SPI_INSTANCE);
23336  </code>
23337  Remarks:
23338  This function implements an operation of the enable control feature. This
23339  feature may not be available on all devices. Please refer to the specific
23340  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23341  in your application to automatically determine whether this feature is available.
23342  */
23343 
23344 void
23346  SPI_MODULE_ID index ) ;
23347 //******************************************************************************
23348 /* Function:
23349  void PLIB_SPI_StopInIdleEnable (SPI_MODULE_ID index)
23350  Summary:
23351  Discontinues module operation when the device enters Idle mode.
23352  Description:
23353  This function sets up the SPI module such that module operation is disabled
23354  when the device enters Idle mode.
23355  This operation is atomic.
23356  Precondition:
23357  None.
23358  Parameters:
23359  index - Identifier for the device instance to be configured
23360  Returns:
23361  None.
23362  Example:
23363  <code>
23364  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23365  // application developer.
23366  PLIB_SPI_StopInIdleEnable(MY_SPI_INSTANCE);
23367  </code>
23368  Remarks:
23369  This function implements an operation of the stop in idle control feature.
23370  This feature may not be available on all devices. Please refer to the
23371  specific device data sheet to determine availability or use
23372  "PLIB_SPI_ExistsStopInIdleControl" in your application to automatically
23373  determine if this feature is available.
23374  */
23375 
23376 void
23378  SPI_MODULE_ID index ) ;
23379 //******************************************************************************
23380 /* Function:
23381  void PLIB_SPI_StopInIdleDisable (SPI_MODULE_ID index)
23382  Summary:
23383  Continues module operation when the device enters Idle mode.
23384  Description:
23385  This function sets up the SPI module such that module operation is continued
23386  when the device enters Idle mode.
23387  This operation is atomic.
23388  Precondition:
23389  None.
23390  Parameters:
23391  index - Identifier for the device instance to be configured
23392  Returns:
23393  None.
23394  Example:
23395  <code>
23396  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23397  // application developer.
23398  PLIB_SPI_StopInIdleDisable(MY_SPI_INSTANCE);
23399  </code>
23400  Remarks:
23401  This function implements an operation of the stop in idle control feature.
23402  This feature may not be available on all devices. Please refer to the
23403  specific device data sheet to determine availability or use
23404  "PLIB_SPI_ExistsStopInIdleControl" in your application to determine whether
23405  this feature is available.
23406  */
23407 
23408 void
23410  SPI_MODULE_ID index ) ;
23411 //******************************************************************************
23412 /* Function:
23413  bool PLIB_SPI_ReceiverHasOverflowed (SPI_MODULE_ID index)
23414  Summary:
23415  Returns the current status of the SPI receiver overflow.
23416  Description:
23417  This function returns the current status of the SPI receiver overflow.
23418  This operation is atomic.
23419  Precondition:
23420  None.
23421  Parameters:
23422  index - Identifier for the device instance to be configured
23423  Returns:
23424  SPI receiver overflow status:
23425  - true - A new byte/word is completely received and discarded.
23426  The user software has not read the previous data in
23427  the SPI buffer register.
23428  - false - No Overflow has occurred
23429  Example:
23430  <code>
23431  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23432  // application developer.
23433  bool overflowstate = PLIB_SPI_ReceiverHasOverflowed(MY_SPI_INSTANCE);
23434  </code>
23435  Remarks:
23436  This function implements an operation of the receiver overflow status feature.
23437  This feature may not be available on all devices. Please refer to the
23438  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23439  in your application to automatically determine whether this feature is available.
23440  */
23441 
23442 bool
23444  SPI_MODULE_ID index ) ;
23445 //******************************************************************************
23446 /* Function:
23447  void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
23448  Summary:
23449  Clears the SPI receive overflow flag.
23450  Description:
23451  This function clears the SPI receive overflow flag.
23452  This operation is atomic.
23453  Precondition:
23454  None.
23455  Parameters:
23456  index - Identifier for the device instance to be configured
23457  Returns:
23458  None.
23459  Example:
23460  <code>
23461  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23462  // application developer.
23463  PLIB_SPI_ReceiverOverflowClear(MY_SPI_INSTANCE);
23464  </code>
23465  Remarks:
23466  This function implements an operation of the receiver overflow status feature.
23467  This feature may not be available on all devices. Please refer to the
23468  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23469  in your application to automatically determine whether this feature is available.
23470  */
23471 
23472 void
23474  SPI_MODULE_ID index ) ;
23475 //******************************************************************************
23476 /* Function:
23477  bool PLIB_SPI_TransmitBufferIsFull (SPI_MODULE_ID index)
23478  Summary:
23479  Returns the current transmit buffer status of the SPI module.
23480  Description:
23481  This function returns the current transmit buffer status of the SPI module.
23482  This operation is atomic.
23483  Precondition:
23484  None.
23485  Parameters:
23486  index - Identifier for the device instance to be configured
23487  Returns:
23488  - true - Transmit not yet started, transmit buffer is full
23489  - false - Transmit started, transmit buffer is empty/not full
23490  Example:
23491  <code>
23492  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23493  // application developer.
23494  bool buffullstate = PLIB_SPI_TransmitBufferIsFull (MY_SPI_INSTANCE);
23495  </code>
23496  Remarks:
23497  In Standard Buffer mode - automatically set in hardware when SPI buffer writes
23498  occur, loading the transmit buffer. Automatically cleared in hardware when
23499  the SPI module transfers data from the transmit buffer to the shift register.
23500  In Enhanced Buffer mode - automatically set in hardware when SPI buffer writes
23501  occur, loading the last available buffer. Automatically cleared in hardware
23502  when the buffer is available for writing.
23503  This function implements an operation of the transmit buffer status feature.
23504  This feature may not be available on all devices. Please refer to the
23505  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferFullStatus"
23506  in your application to automatically determine whether this feature is available.
23507  */
23508 
23509 bool
23511  SPI_MODULE_ID index ) ;
23512 //******************************************************************************
23513 /* Function:
23514  bool PLIB_SPI_ReceiverBufferIsFull (SPI_MODULE_ID index)
23515  Summary:
23516  Returns the current status of the SPI receive buffer.
23517  Description:
23518  This function returns the current status of the SPI receive buffer.
23519  This operation is atomic.
23520  Precondition:
23521  None.
23522  Parameters:
23523  index - Identifier for the device instance to be configured
23524  Returns:
23525  Receiver Buffer Full Status:
23526  - true - Receive complete, receive buffer is full
23527  - false - Receive is not complete, receive buffer is empty
23528  Example:
23529  <code>
23530  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23531  // application developer.
23532  bool receivefullstate = PLIB_SPI_ReceiverBufferIsFull (MY_SPI_INSTANCE);
23533  </code>
23534  Remarks:
23535  In Standard Buffer mode - automatically set in hardware when the SPI module
23536  transfers data from the shift register to the receive buffer. Automatically
23537  cleared in hardware when the core reads the SPI buffer, read in the receive buffer.
23538  In Enhanced Buffer mode - automatically set in hardware when the SPI module
23539  transfers data from the shift register to the receive buffer, filling the
23540  last unread buffer. Automatically cleared in hardware when a buffer is available
23541  for a transfer from the shift register.
23542  This function implements an operation of the receiver buffer status feature.
23543  This feature may not be available on all devices. Please refer to the
23544  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveBufferStatus"
23545  in your application to automatically determine whether this feature is available.
23546  */
23547 
23548 bool
23550  SPI_MODULE_ID index ) ;
23551 //******************************************************************************
23552 /* Function:
23553  void PLIB_SPI_PinEnable (SPI_MODULE_ID index,SPI_PIN pin)
23554  Summary:
23555  Enables the selected SPI pins.
23556  Description:
23557  This function enables the selected SPI pins.
23558  Precondition:
23559  None.
23560  Parameters:
23561  index - Identifier for the device instance to be configured
23562  pin - One of the SPI_PIN enumeration values as the SPI pin
23563  Returns:
23564  None.
23565  Example:
23566  <code>
23567  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23568  // application developer.
23569  PLIB_SPI_PinEnable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
23570  </code>
23571  Remarks:
23572  This function implements an operation of the pin control feature.
23573  This feature may not be available on all devices. Please refer to the
23574  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
23575  in your application to automatically determine whether this feature is available.
23576  */
23577 
23578 void
23580  SPI_MODULE_ID index ,
23581  SPI_PIN pin ) ;
23582 //******************************************************************************
23583 /* Function:
23584  void PLIB_SPI_PinDisable (SPI_MODULE_ID index, SPI_PIN pin)
23585  Summary:
23586  Enables the selected SPI pins.
23587  Description:
23588  This function enables the selected SPI pins.
23589  Precondition:
23590  None.
23591  Parameters:
23592  index - Identifier for the device instance to be configured
23593  pin - One of the SPI_PIN enumeration values as the SPI pin
23594  Returns:
23595  None.
23596  Example:
23597  <code>
23598  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23599  // application developer.
23600  PLIB_SPI_PinDisable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
23601  </code>
23602  Remarks:
23603  This function implements an operation of the pin control feature.
23604  This feature may not be available on all devices. Please refer to the
23605  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
23606  in your application to automatically determine whether this feature is available.
23607  */
23608 
23609 void
23611  SPI_MODULE_ID index ,
23612  SPI_PIN pin ) ;
23613 //******************************************************************************
23614 /* Function:
23615  void PLIB_SPI_CommunicationWidthSelect (SPI_MODULE_ID index,
23616  SPI_COMMUNICATION_WIDTH width )
23617  Summary:
23618  Selects the data width for the SPI communication.
23619  Description:
23620  This function selects the data width for the SPI communication.
23621  This operation is atomic.
23622  Precondition:
23623  None.
23624  Parameters:
23625  index - Identifier for the device instance to be configured
23626  width - One of the SPI_COMMUNICATION_WIDTH enumeration values as the
23627  SPI buffer width
23628  Returns:
23629  None.
23630  Example:
23631  <code>
23632  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23633  // application developer.
23634  PLIB_SPI_CommunicationWidthSelect(MY_SPI_INSTANCE, SPI_COMMUNICATION_WIDTH_8BITS);
23635  </code>
23636  Remarks:
23637  This function implements an operation of the communication width feature.
23638  This feature may not be available on all devices. Please refer to the
23639  specific device data sheet to determine availability or use "PLIB_SPI_ExistsCommunicationWidth"
23640  in your application to automatically determine whether this feature is available.
23641  */
23642 
23643 void
23645  SPI_MODULE_ID index ,
23646  SPI_COMMUNICATION_WIDTH width ) ;
23647 //******************************************************************************
23648 /* Function:
23649  void PLIB_SPI_AudioCommunicationWidthSelect (SPI_MODULE_ID index,
23650  SPI_AUDIO_COMMUNICATION_WIDTH width )
23651  Summary:
23652  Selects the data width for the SPI audio communication.
23653  Description:
23654  This function selects the data width for the SPI audio communication.
23655  This operation is atomic.
23656  Precondition:
23657  None.
23658  Parameters:
23659  index - Identifier for the device instance to be configured
23660  width - One of the SPI_AUDIO_COMMUNICATION_WIDTH enumeration values as the
23661  SPI buffer width
23662  Returns:
23663  None.
23664  Example:
23665  <code>
23666  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23667  // application developer.
23668  PLIB_SPI_AudioCommunicationWidthSelect(MY_SPI_INSTANCE,
23669  SPI_AUDIO_COMMUNICATION_32DATA_32FIFO_32CHANNEL);
23670  </code>
23671  Remarks:
23672  This mode is available only when PLIB_SPI_AudioProtocolEnable is enabled.
23673  This function implements an operation of the audio communication width feature.
23674  This feature may not be available on all devices. Please refer to the
23675  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioCommunicationWidth"
23676  in your application to automatically determine whether this feature is available.
23677  */
23678 
23679 void
23681  SPI_MODULE_ID index ,
23682  SPI_AUDIO_COMMUNICATION_WIDTH mode ) ;
23683 //******************************************************************************
23684 /* Function:
23685  void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index,
23686  SPI_INPUT_SAMPLING_PHASE phase)
23687  Summary:
23688  Selects the SPI data input sample phase.
23689  Description:
23690  This function selects the input sampling phase in Master mode.
23691  Precondition:
23692  None.
23693  Parameters:
23694  index - Identifier for the device instance to be configured
23695  phase - One of the SPI_INPUT_SAMPLING_PHASE as the SPI input
23696  sampling phase
23697  Returns:
23698  None.
23699  Example:
23700  <code>
23701  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23702  // application developer.
23703  PLIB_SPI_InputSamplePhaseSelect(MY_SPI_INSTANCE, SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE);
23704  </code>
23705  Remarks:
23706  This function implements an operation of the input sample phase feature.
23707  This feature may not be available on all devices. Please refer to the
23708  specific device data sheet to determine availability or use "PLIB_SPI_ExistsInputSamplePhase"
23709  in your application to automatically determine whether this feature is available.
23710  */
23711 
23712 void
23714  SPI_MODULE_ID index ,
23715  SPI_INPUT_SAMPLING_PHASE phase ) ;
23716 //******************************************************************************
23717 /* Function:
23718  void PLIB_SPI_OutputDataPhaseSelect (SPI_MODULE_ID index,
23719  SPI_OUTPUT_DATA_PHASE data)
23720  Summary:
23721  Selects serial output data change.
23722  Description:
23723  This function selects serial output data change.
23724  Precondition:
23725  None.
23726  Parameters:
23727  index - Identifier for the device instance to be configured
23728  data - One of the SPI_OUTPUT_DATA_PHASE enumeration values as the
23729  SPI serial output data change
23730  Returns:
23731  None.
23732  Example:
23733  <code>
23734  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23735  // application developer.
23736  PLIB_SPI_OutputDataPhaseSelect(MY_SPI_INSTANCE, SPI_OUTPUT_DATA_PHASE_ON_ACTIVE_TO_IDLE_CLOCK);
23737  </code>
23738  Remarks:
23739  This function implements an operation of the output data phase feature.
23740  This feature may not be available on all devices. Please refer to the
23741  specific device data sheet to determine availability or use "PLIB_SPI_ExistsOutputDataPhase"
23742  in your application to automatically determine whether this feature is available.
23743  */
23744 
23745 void
23747  SPI_MODULE_ID index ,
23748  SPI_OUTPUT_DATA_PHASE phase ) ;
23749 //******************************************************************************
23750 /* Function:
23751  void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index,
23752  SPI_CLOCK_POLARITY polarity)
23753  Summary:
23754  Enables clock polarity.
23755  Description:
23756  This function enables clock polarity.
23757  Precondition:
23758  None.
23759  Parameters:
23760  index - Identifier for the device instance to be configured
23761  polarity - One of the SPI_CLOCK_POLARITY enumeration values as the SPI clock polarity
23762  Returns:
23763  None.
23764  Example:
23765  <code>
23766  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23767  // application developer.
23768  PLIB_SPI_ClockPolaritySelect(MY_SPI_INSTANCE, SPI_CLOCK_POLARITY_IDLE_HIGH );
23769  </code>
23770  Remarks:
23771  This function implements an operation of the clock polarity feature.
23772  This feature may not be available on all devices. Please refer to the
23773  specific device data sheet to determine availability or use "PLIB_SPI_ExistsClockPolarity"
23774  in your application to automatically determine whether this feature is available.
23775  */
23776 
23777 void
23779  SPI_MODULE_ID index ,
23780  SPI_CLOCK_POLARITY polarity ) ;
23781 //******************************************************************************
23782 /* Function:
23783  void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
23784  Summary:
23785  Enables the SPI in Master mode.
23786  Description:
23787  This function enables the SPI in Master mode.
23788  This operation is atomic.
23789  Precondition:
23790  None.
23791  Parameters:
23792  index - Identifier for the device instance to be configured
23793  Returns:
23794  None.
23795  Example:
23796  <code>
23797  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23798  // application developer.
23799  PLIB_SPI_MasterEnable(MY_SPI_INSTANCE);
23800  </code>
23801  Remarks:
23802  This function implements an operation of the master enable control feature.
23803  This feature may not be available on all devices. Please refer to the
23804  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
23805  in your application to automatically determine whether this feature is available.
23806  */
23807 
23808 void
23810  SPI_MODULE_ID index ) ;
23811 //******************************************************************************
23812 /* Function:
23813  void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
23814  Summary:
23815  Enables the SPI in Slave mode.
23816  Description:
23817  This function enables the SPI in Slave mode.
23818  This operation is atomic.
23819  Precondition:
23820  None.
23821  Parameters:
23822  index - Identifier for the device instance to be configured
23823  Returns:
23824  None.
23825  Example:
23826  <code>
23827  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23828  // application developer.
23829  PLIB_SPI_SlaveEnable(MY_SPI_INSTANCE);
23830  </code>
23831  Remarks:
23832  This function implements an operation of the master enable control feature.
23833  This feature may not be available on all devices. Please refer to the
23834  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
23835  in your application to automatically determine whether this feature is available.
23836  */
23837 
23838 void
23840  SPI_MODULE_ID index ) ;
23841 //******************************************************************************
23842 /* Function:
23843  void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency,
23844  uint32_t baudRate )
23845  Summary:
23846  Sets the baud rate to the desired value.
23847  Description:
23848  This function sets the baud rate to the desired value.
23849  Precondition:
23850  None.
23851  Parameters:
23852  index - Identifier for the device instance to be configured
23853  clockFrequency - Clock frequency
23854  baudrate - Baud rate value
23855  Returns:
23856  None.
23857  Example:
23858  <code>
23859  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23860  // application developer.
23861  PLIB_SPI_BaudRateSet(MY_SPI_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
23862  </code>
23863  Remarks:
23864  Setting a new baud rate value causes the baud rate timer to reset.
23865  This ensures that the baud rate timer does not have to overflow before
23866  outputting the new baud rate.
23867  If the system clock is changed during an active receive operation, a
23868  receive error or data loss may result. To avoid this issue, verify that
23869  no receptions are in progress before changing the system clock.
23870  This function implements an operation of the baud rate set feature.
23871  This feature may not be available on all devices. Please refer to the
23872  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRate"
23873  in your application to automatically determine whether this feature is available.
23874  */
23875 
23876 void
23878  SPI_MODULE_ID index ,
23879  uint32_t clockFrequency ,
23880  uint32_t baudRate ) ;
23881 //******************************************************************************
23882 /* Function:
23883  bool PLIB_SPI_IsBusy (SPI_MODULE_ID index)
23884  Summary:
23885  Returns the current SPI module activity status.
23886  Description:
23887  This function returns the current SPI module activity status.
23888  This operation is atomic.
23889  Precondition:
23890  None.
23891  Parameters:
23892  index - Identifier for the device instance to be configured
23893  Returns:
23894  - true - SPI module is currently busy with some transactions
23895  - false - SPI module is currently idle
23896  Example:
23897  <code>
23898  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23899  // application developer.
23900  bool status = PLIB_SPI_IsBusy(MY_SPI_INSTANCE);
23901  </code>
23902  Remarks:
23903  This function implements an operation of the bus status feature.
23904  This feature may not be available on all devices. Please refer to the
23905  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBusStatus"
23906  in your application to automatically determine whether this feature is available.
23907  */
23908 
23909 bool
23910  PLIB_SPI_IsBusy (
23911  SPI_MODULE_ID index ) ;
23912 //******************************************************************************
23913 /* Function:
23914  bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
23915  Summary:
23916  Returns the current status of the receive (RX) FIFO sign-extended data.
23917  Description:
23918  This function returns the current status of the receive (RX) FIFO
23919  sign-extended data.
23920  This operation is atomic.
23921  Precondition:
23922  None.
23923  Parameters:
23924  index - Identifier for the device instance to be configured
23925  Returns:
23926  - true - Data from RX FIFO is sign-extended
23927  - false - Data from RX FIFO is not sign-extended
23928  Example:
23929  <code>
23930  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23931  // application developer.
23932  bool Status = PLIB_SPI_ReadDataIsSignExtended(MY_SPI_INSTANCE);
23933  </code>
23934  Remarks:
23935  This function implements an operation of the data sign feature.
23936  This feature may not be available on all devices. Please refer to the
23937  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReadDataSignStatus"
23938  in your application to automatically determine whether this feature is available.
23939  */
23940 
23941 bool
23943  SPI_MODULE_ID index ) ;
23944 //******************************************************************************
23945 /* Function:
23946  void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
23947  Summary:
23948  Enables Master mode slave select.
23949  Description:
23950  This function enables Master mode slave select.
23951  This operation is atomic.
23952  Precondition:
23953  None.
23954  Parameters:
23955  index - Identifier for the device instance to be configured
23956  Returns:
23957  None.
23958  Example:
23959  <code>
23960  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23961  // application developer.
23962  PLIB_SPI_SlaveSelectEnable(MY_SPI_INSTANCE);
23963  </code>
23964  Remarks:
23965  This feature does not support Framed SPI mode.
23966  This function implements an operation of the Master mode slave select feature.
23967  This feature may not be available on all devices. Please refer to the
23968  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
23969  in your application to automatically determine whether this feature is available.
23970 
23971  To enable Slave mode slave select pin (SSEN), PLIB_SPI_PinEnable API can be used.
23972  */
23973 
23974 void
23976  SPI_MODULE_ID index ) ;
23977 //******************************************************************************
23978 /* Function:
23979  void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
23980  Summary:
23981  Disables Master mode slave select.
23982  Description:
23983  This function disables Master mode slave select.
23984  This operation is atomic.
23985  Precondition:
23986  None.
23987  Parameters:
23988  index - Identifier for the device instance to be configured
23989  Returns:
23990  None.
23991  Example:
23992  <code>
23993  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23994  // application developer.
23995  PLIB_SPI_SlaveSelectDisable(MY_SPI_INSTANCE);
23996  </code>
23997  Remarks:
23998  This feature does not support Framed SPI mode.
23999  This function implements an operation of the slave select feature.
24000  This feature may not be available on all devices. Please refer to the
24001  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
24002  in your application to automatically determine whether this feature is available.
24003 
24004  To disable Slave mode slave select pin (SSEN), PLIB_SPI_PinDisable API can be used.
24005  */
24006 
24007 void
24009  SPI_MODULE_ID index ) ;
24010 //******************************************************************************
24011 /* Function:
24012  bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
24013  Summary:
24014  Returns the current status of the transmit underrun.
24015  Description:
24016  This function returns the current status of the transmit underrun.
24017  This operation is atomic.
24018  Precondition:
24019  None.
24020  Parameters:
24021  index - Identifier for the device instance to be configured
24022  Returns:
24023  - true - Transmit buffer has encountered an underrun condition
24024  - false - Transmit buffer run has not encountered an underrun condition
24025  Example:
24026  <code>
24027  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24028  // application developer.
24029  bool Status = PLIB_SPI_TransmitUnderRunStatusGet(MY_SPI_INSTANCE);
24030  </code>
24031  Remarks:
24032  Valid in Framed Sync mode.
24033  This function implements an operation of the transmit underrun status feature.
24034  This feature may not be available on all devices. Please refer to the
24035  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitUnderRunStatus"
24036  in your application to automatically determine whether this feature is available.
24037  */
24038 
24039 bool
24041  SPI_MODULE_ID index ) ;
24042 //******************************************************************************
24043 /* Function:
24044  void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
24045  Summary:
24046  Clears the SPI transmit underrun flag.
24047  Description:
24048  This function clears the SPI transmit underrun flag.
24049  This operation is atomic.
24050  Precondition:
24051  None.
24052  Parameters:
24053  index - Identifier for the device instance to be configured
24054  Returns:
24055  None.
24056  Example:
24057  <code>
24058  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24059  // application developer.
24060  PLIB_SPI_TransmitUnderRunStatusClear(MY_SPI_INSTANCE);
24061  </code>
24062  Remarks:
24063  This function implements an operation of the transmit underrun status feature.
24064  This feature may not be available on all devices. Please refer to the
24065  specific device data sheet to determine availability or use "ExistsTransmitUnderRunStatus"
24066  in your application to automatically determine whether this feature is available.
24067  */
24068 
24069 void
24071  SPI_MODULE_ID index ) ;
24072 //******************************************************************************
24073 /* Function:
24074  bool PLIB_SPI_TransmitBufferIsEmpty (SPI_MODULE_ID index)
24075  Summary:
24076  Returns the current status of the transmit buffer.
24077  Description:
24078  This function returns the current status of the transmit buffer.
24079  This operation is atomic.
24080  Precondition:
24081  None.
24082  Parameters:
24083  index - Identifier for the device instance to be configured
24084  Returns:
24085  - true - Transmit buffer is empty
24086  - false - Transmit buffer is not empty
24087  Example:
24088  <code>
24089  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24090  // application developer.
24091  bool Status = PLIB_SPI_TransmitBufferIsEmpty(MY_SPI_INSTANCE);
24092  </code>
24093  Remarks:
24094  This function implements an operation of the transmit buffer empty status feature.
24095  This feature may not be available on all devices. Please refer to the
24096  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferEmptyStatus"
24097  in your application to automatically determine whether this feature is available.
24098  */
24099 
24100 bool
24102  SPI_MODULE_ID index ) ;
24103 //******************************************************************************
24104 /* Function:
24105  void PLIB_SPI_FIFOEnable (SPI_MODULE_ID index)
24106  Summary:
24107  Enables the SPI enhanced buffer.
24108  Description:
24109  This function enables the SPI enhanced buffer.
24110  This operation is atomic.
24111  Precondition:
24112  None.
24113  Parameters:
24114  index - Identifier for the device instance to be configured
24115  Returns:
24116  None.
24117  Example:
24118  <code>
24119  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24120  // application developer.
24121  PLIB_SPI_FIFOEnable(MY_SPI_INSTANCE);
24122  </code>
24123  Remarks:
24124  This enables the enhanced buffer mode.
24125  This function implements an operation of the FIFO control feature.
24126  This feature may not be available on all devices. Please refer to the
24127  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24128  in your application to automatically determine whether this feature is available.
24129  */
24130 
24131 void
24133  SPI_MODULE_ID index ) ;
24134 //******************************************************************************
24135 /* Function:
24136  void PLIB_SPI_FIFODisable (SPI_MODULE_ID index)
24137  Summary:
24138  Disables the SPI enhanced buffer.
24139  Description:
24140  This function disables the SPI enhanced buffer.
24141  This operation is atomic.
24142  Precondition:
24143  None.
24144  Parameters:
24145  index - Identifier for the device instance to be configured
24146  Returns:
24147  None.
24148  Example:
24149  <code>
24150  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24151  // application developer.
24152  PLIB_SPI_FIFODisable(MY_SPI_INSTANCE);
24153  </code>
24154  Remarks:
24155  Enables the legacy standard single buffer mode.
24156  This function implements an operation of the FIFO control feature.
24157  This feature may not be available on all devices. Please refer to the
24158  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24159  in your application to automatically determine whether this feature is available.
24160  */
24161 
24162 void
24164  SPI_MODULE_ID index ) ;
24165 //******************************************************************************
24166 /* Function:
24167  uint8_t PLIB_SPI_FIFOCountGet (SPI_MODULE_ID index, SPI_FIFO_TYPE type)
24168  Summary:
24169  Reads the SPI Buffer Element Count bits for either receive or transmit.
24170  Description:
24171  This function reads the number of SPI transfers pending for Master mode
24172  and the number of unread SPI transfers for Slave mode.
24173  Precondition:
24174  None.
24175  Parameters:
24176  index - Identifier for the device instance to be configured
24177  type - One of the SPI_FIFO_TYPE enumeration values
24178  Returns:
24179  CountValue - Buffer element count bits
24180  Example:
24181  <code>
24182  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24183  // application developer.
24184  uint8_t count = PLIB_SPI_FIFOCountGet(MY_SPI_INSTANCE,SPI_FIFO_TYPE_TRANSMIT);
24185  </code>
24186  Remarks:
24187  Valid in Enhanced Buffer mode.
24188  This function implements an operation of the FIFO control feature.
24189  This feature may not be available on all devices. Please refer to the
24190  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOCount"
24191  in your application to automatically determine whether this feature is available.
24192  */
24193 
24194 uint8_t
24196  SPI_MODULE_ID index ,
24197  SPI_FIFO_TYPE type ) ;
24198 //******************************************************************************
24199 /* Function:
24200  bool PLIB_SPI_FIFOShiftRegisterIsEmpty (SPI_MODULE_ID index)
24201  Summary:
24202  Returns the current status of the SPI shift register.
24203  Description:
24204  This function returns the current status of the SPI shift register.
24205  This operation is atomic.
24206  Precondition:
24207  None.
24208  Parameters:
24209  index - Identifier for the device instance to be configured
24210  Returns:
24211  - true - SPI shift register is empty and ready to send or receive
24212  - false - SPI shift register is not empty
24213  Example:
24214  <code>
24215  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24216  // application developer.
24217  bool Status = PLIB_SPI_FIFOShiftRegisterIsEmpty(MY_SPI_INSTANCE);
24218  </code>
24219  Remarks:
24220  Valid in Enhanced Buffer mode.
24221  This function implements an operation of the FIFO status feature.
24222  This feature may not be available on all devices. Please refer to the
24223  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus"
24224  in your application to automatically determine whether this feature is available.
24225  */
24226 
24227 bool
24229  SPI_MODULE_ID index ) ;
24230 //******************************************************************************
24231 /* Function:
24232  bool PLIB_SPI_ReceiverFIFOIsEmpty (SPI_MODULE_ID index)
24233  Summary:
24234  Returns the current status of the SPI receive FIFO.
24235  Description:
24236  This function returns the current status of the SPI receive FIFO.
24237  This operation is atomic.
24238  Precondition:
24239  None.
24240  Parameters:
24241  index - Identifier for the device instance to be configured
24242  Returns:
24243  - true - Receive FIFO is empty
24244  - false - Receive FIFO is not empty
24245  Example:
24246  <code>
24247  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24248  // application developer.
24249  bool fifostate = PLIB_SPI_ReceiverFIFOIsEmpty (MY_SPI_INSTANCE);
24250  </code>
24251  Remarks:
24252  Valid in Enhanced Buffer mode.
24253  This function implements an operation of the FIFO status feature.
24254  This feature may not be available on all devices. Please refer to the
24255  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveFIFOStatus"
24256  in your application to automatically determine whether this feature is available.
24257  */
24258 
24259 bool
24261  SPI_MODULE_ID index ) ;
24262 //******************************************************************************
24263 /* Function:
24264  void PLIB_SPI_FIFOInterruptModeSelect (SPI_MODULE_ID index,
24265  SPI_FIFO_INTERRUPT mode)
24266  Summary:
24267  Selects the SPI buffer interrupt mode.
24268  Description:
24269  This function selects the SPI buffer interrupt mode from SPI_FIFO_INTERRUPT.
24270  Precondition:
24271  None.
24272  Parameters:
24273  index - Identifier for the device instance to be configured
24274  mode - One of the SPI_FIFO_INTERRUPT enumeration values as the SPI buffer
24275  interrupt mode
24276  Returns:
24277  None.
24278  Example:
24279  <code>
24280  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24281  // application developer.
24282  PLIB_SPI_FIFOInterruptModeSelect(MY_SPI_INSTANCE,
24283  SPI_FIFO_INTERRUPT_WHEN_TRANSMIT_BUFFER_IS_NOT_FULL);
24284  </code>
24285  Remarks:
24286  Valid in Enhanced Buffer mode.
24287  This function implements an operation of the FIFO interrupt feature.
24288  This feature may not be available on all devices. Please refer to the
24289  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOInterruptMode"
24290  in your application to automatically determine whether this feature is available.
24291  */
24292 
24293 void
24295  SPI_MODULE_ID index ,
24296  SPI_FIFO_INTERRUPT mode ) ;
24297 //******************************************************************************
24298 /* Function:
24299  void PLIB_SPI_FramedCommunicationEnable (SPI_MODULE_ID index)
24300  Summary:
24301  Enables framed SPI support.
24302  Description:
24303  This function enables framed SPI support.
24304  This operation is atomic.
24305  Precondition:
24306  None.
24307  Parameters:
24308  index - Identifier for the device instance to be configured
24309  Returns:
24310  None.
24311  Example:
24312  <code>
24313  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24314  // application developer.
24315  PLIB_SPI_FramedCommunicationEnable(MY_SPI_INSTANCE);
24316  </code>
24317  Remarks:
24318  This function implements an operation of the framed communication feature.
24319  This feature may not be available on all devices. Please refer to the
24320  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24321  in your application to automatically determine whether this feature is available.
24322  */
24323 
24324 void
24326  SPI_MODULE_ID index ) ;
24327 //******************************************************************************
24328 /* Function:
24329  void PLIB_SPI_FramedCommunicationDisable (SPI_MODULE_ID index)
24330  Summary:
24331  Disables framed SPI support.
24332  Description:
24333  This function disables framed SPI support.
24334  This operation is atomic.
24335  Precondition:
24336  None.
24337  Parameters:
24338  index - Identifier for the device instance to be configured
24339  Returns:
24340  None.
24341  Example:
24342  <code>
24343  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24344  // application developer.
24345  PLIB_SPI_FramedCommunicationDisable(MY_SPI_INSTANCE);
24346  </code>
24347  Remarks:
24348  This function implements an operation of the framed communication feature.
24349  This feature may not be available on all devices. Please refer to the
24350  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24351  in your application to automatically determine whether this feature is available.
24352  */
24353 
24354 void
24356  SPI_MODULE_ID index ) ;
24357 //******************************************************************************
24358 /* Function:
24359  void PLIB_SPI_FrameSyncPulseDirectionSelect (SPI_MODULE_ID index,
24360  SPI_FRAME_PULSE_DIRECTION direction)
24361  Summary:
24362  Selects the frame sync pulse direction.
24363  Description:
24364  This function selects the frame sync pulse direction.
24365  Precondition:
24366  None.
24367  Parameters:
24368  index - Identifier for the device instance to be configured
24369  direction - One of the SPI_FRAME_PULSE_DIRECTION enumeration values
24370  as the SPI frame sync pulse polarity
24371  Returns:
24372  None.
24373  Example:
24374  <code>
24375  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24376  // application developer.
24377  PLIB_SPI_FrameSyncPulseDirectionSelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_DIRECTION_INPUT );
24378  </code>
24379  Remarks:
24380  This function implements an operation of the framed communication feature.
24381  This feature may not be available on all devices. Please refer to the
24382  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseDirection"
24383  in your application to automatically determine whether this feature is available.
24384  */
24385 
24386 void
24388  SPI_MODULE_ID index ,
24389  SPI_FRAME_PULSE_DIRECTION direction ) ;
24390 //******************************************************************************
24391 /* Function:
24392  void PLIB_SPI_FrameSyncPulsePolaritySelect (SPI_MODULE_ID index,
24393  SPI_FRAME_PULSE_POLARITY polarity)
24394  Summary:
24395  Selects the frame sync pulse polarity.
24396  Description:
24397  This function selects the frame sync pulse polarity.
24398  Precondition:
24399  None.
24400  Parameters:
24401  index - Identifier for the device instance to be configured
24402  polarity - One of the SPI_FRAME_PULSE_POLARITY enumeration values as the SPI frame
24403  sync pulse polarity
24404  Returns:
24405  None.
24406  Example:
24407  <code>
24408  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24409  // application developer.
24410  PLIB_SPI_FrameSyncPulsePolaritySelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_POLARITY_ACTIVE_HIGH );
24411  </code>
24412  Remarks:
24413  Available only for Frame mode.
24414  This function implements an operation of the framed communication feature.
24415  This feature may not be available on all devices. Please refer to the
24416  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulsePolarity"
24417  in your application to automatically determine whether this feature is available.
24418  */
24419 
24420 void
24422  SPI_MODULE_ID index ,
24423  SPI_FRAME_PULSE_POLARITY polarity ) ;
24424 //******************************************************************************
24425 /* Function:
24426  void PLIB_SPI_FrameSyncPulseEdgeSelect (SPI_MODULE_ID index,
24427  SPI_FRAME_PULSE_EDGE edge)
24428  Summary:
24429  Selects the frame sync pulse edge.
24430  Description:
24431  This function selects the frame sync pulse edge.
24432  Precondition:
24433  None.
24434  Parameters:
24435  index - Identifier for the device instance to be configured
24436  edge - One of the SPI_FRAME_PULSE_EDGE enumeration values as the
24437  SPI frame sync pulse edge
24438  Returns:
24439  None.
24440  Example:
24441  <code>
24442  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24443  // application developer.
24444  PLIB_SPI_FrameSyncPulseEdgeSelect(MY_SPI_INSTANCE,
24445  SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK);
24446  </code>
24447  Remarks:
24448  This function implements an operation of the framed communication feature.
24449  This feature may not be available on all devices. Please refer to the
24450  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseEdge"
24451  in your application to automatically determine whether this feature is available.
24452  */
24453 
24454 void
24456  SPI_MODULE_ID index ,
24457  SPI_FRAME_PULSE_EDGE edge ) ;
24458 //******************************************************************************
24459 /* Function:
24460  void PLIB_SPI_FrameSyncPulseWidthSelect (SPI_MODULE_ID index,
24461  SPI_FRAME_PULSE_WIDTH width)
24462  Summary:
24463  Sets the frame sync pulse width.
24464  Description:
24465  This function sets the frame sync pulse width.
24466  Precondition:
24467  None.
24468  Parameters:
24469  index - Identifier for the device instance to be configured
24470  edge - One of the SPI_FRAME_PULSE_WIDTH enumeration values as the SPI
24471  frame sync pulse width.
24472  Returns:
24473  None.
24474  Example:
24475  <code>
24476  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24477  // application developer.
24478  PLIB_SPI_FrameSyncPulseWidthSelect (MY_SPI_INSTANCE,SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH);
24479  </code>
24480  Remarks:
24481  Length of the word is dependent on the communication mode.
24482  This function implements an operation of the framed communication feature.
24483  This feature may not be available on all devices. Please refer to the
24484  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseWidth"
24485  in your application to automatically determine whether this feature is available.
24486  */
24487 
24488 void
24490  SPI_MODULE_ID index ,
24491  SPI_FRAME_PULSE_WIDTH width ) ;
24492 //******************************************************************************
24493 /* Function:
24494  void PLIB_SPI_FrameSyncPulseCounterSelect (SPI_MODULE_ID index,
24495  SPI_FRAME_SYNC_PULSE pulse)
24496  Summary:
24497  Selects at which character the SPI frame sync pulse is generated.
24498  Description:
24499  This function selects at which character the SPI frame sync pulse is generated.
24500  Precondition:
24501  None.
24502  Parameters:
24503  index - Identifier for the device instance to be configured
24504  pulse - One of the SPI_FRAME_SYNC_PULSE enumeration values as the SPI
24505  frame sync pulse count
24506  Returns:
24507  None.
24508  Example:
24509  <code>
24510  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24511  // application developer.
24512  PLIB_SPI_FrameSyncPulseCounterSelect(MY_SPI_INSTANCE,
24513  SPI_FRAME_SYNC_PULSE_ON_EVERY_32_DATA_CHARACTER );
24514  </code>
24515  Remarks:
24516  This is valid only when PLIB_SPI_FramedCommunicationEnable is enabled.
24517  This function implements an operation of the framed communication feature.
24518  This feature may not be available on all devices. Please refer to the
24519  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseCounter"
24520  in your application to automatically determine whether this feature is available.
24521  */
24522 
24523 void
24525  SPI_MODULE_ID index ,
24526  SPI_FRAME_SYNC_PULSE pulse ) ;
24527 //******************************************************************************
24528 /* Function:
24529  bool PLIB_SPI_FrameErrorStatusGet (SPI_MODULE_ID index)
24530  Summary:
24531  Returns the current status of the SPI frame error.
24532  Description:
24533  This function returns the current status of the SPI frame error.
24534  This operation is atomic.
24535  Precondition:
24536  None.
24537  Parameters:
24538  index - Identifier for the device instance to be configured
24539  Returns:
24540  - true - Frame error detected
24541  - false - No frame error detected
24542  Example:
24543  <code>
24544  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24545  // application developer.
24546  bool status = PLIB_SPI_FrameErrorStatusGet(MY_SPI_INSTANCE);
24547  </code>
24548  Remarks:
24549  Valid only if Frame mode is enabled.
24550  This function implements an operation of the framed communication feature.
24551  This feature may not be available on all devices. Please refer to the
24552  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameErrorStatus"
24553  in your application to automatically determine whether this feature is available.
24554  */
24555 
24556 bool
24558  SPI_MODULE_ID index ) ;
24559 //******************************************************************************
24560 /* Function:
24561  void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
24562  Summary:
24563  Clears the SPI frame error flag.
24564  Description:
24565  This function clears the SPI frame error flag.
24566  This operation is atomic.
24567  Precondition:
24568  None.
24569  Parameters:
24570  index - Identifier for the device instance to be configured
24571  Returns:
24572  None.
24573  Example:
24574  <code>
24575  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24576  // application developer.
24577  PLIB_SPI_FrameErrorStatusClear(MY_SPI_INSTANCE);
24578  </code>
24579  Remarks:
24580  This function implements an operation of the frame error status feature.
24581  This feature may not be available on all devices. Please refer to the
24582  specific device data sheet to determine availability or use "ExistsFrameErrorStatus"
24583  in your application to automatically determine whether this feature is available.
24584  */
24585 
24586 void
24588  SPI_MODULE_ID index ) ;
24589 //******************************************************************************
24590 /* Function:
24591  void PLIB_SPI_BufferClear (SPI_MODULE_ID index)
24592  Summary:
24593  Clears the SPI receive buffer.
24594  Description:
24595  This function clears the SPI receive buffer.
24596  In Enhanced Buffer mode, this functions clears the full RX FIFO.
24597  This operation is atomic.
24598  Precondition:
24599  None.
24600  Parameters:
24601  index - Identifier for the device instance to be configured
24602  Returns:
24603  None.
24604  Example:
24605  <code>
24606  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24607  // application developer.
24608  //This call will flush the receive buffer.
24609  PLIB_SPI_BufferClear(MY_SPI_INSTANCE);
24610  </code>
24611  Remarks:
24612  This function implements an operation of the buffer control feature.
24613  This feature may not be available on all devices. Please refer to the
24614  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24615  in your application to automatically determine whether this feature is available.
24616  */
24617 
24618 void
24620  SPI_MODULE_ID index ) ;
24621 //******************************************************************************
24622 /* Function:
24623  uint8_t PLIB_SPI_BufferRead (SPI_MODULE_ID index)
24624  Summary:
24625  Returns the SPI buffer value.
24626  Description:
24627  This function returns the SPI buffer value.
24628  This operation is atomic.
24629  Precondition:
24630  None.
24631  Parameters:
24632  index - Identifier for the device instance to be configured
24633  Returns:
24634  Reads the SPI buffer.
24635  Example:
24636  <code>
24637  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24638  // application developer.
24639  uint8_t bufferValue = PLIB_SPI_BufferRead(MY_SPI_INSTANCE);
24640  </code>
24641  Remarks:
24642  This function implements an operation of the buffer control feature.
24643  This feature may not be available on all devices. Please refer to the
24644  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24645  in your application to automatically determine whether this feature is available.
24646  */
24647 
24648 uint8_t
24650  SPI_MODULE_ID index ) ;
24651 //******************************************************************************
24652 /* Function:
24653  uint16_t PLIB_SPI_BufferRead16bit ( SPI_MODULE_ID index )
24654  Summary:
24655  Returns 16-bit SPI buffer value.
24656  Description:
24657  This function returns 16-bit SPI buffer value.
24658  This operation is atomic.
24659  Precondition:
24660  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24661  Parameters:
24662  index - Identifier for the device instance to be configured
24663  Returns:
24664  Returns the SPI 16-bit buffer value.
24665  Example:
24666  <code>
24667 #define MY_SPI_INSTANCE SPI_ID_1
24668 
24669  uint16_t bufferValue = PLIB_SPI_BufferRead16bit( MY_SPI_INSTANCE );
24670  </code>
24671  Remarks:
24672  This function implements an operation of the buffer control feature.
24673  This feature may not be available on all devices. Please refer to the
24674  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
24675  in your application to automatically determine whether this feature is available.
24676  */
24677 
24678 uint16_t
24680  SPI_MODULE_ID index ) ;
24681 //******************************************************************************
24682 /* Function:
24683  uint32_t PLIB_SPI_BufferRead32bit ( SPI_MODULE_ID index )
24684  Summary:
24685  Returns 32-bit SPI buffer value.
24686  Description:
24687  This function returns 32-bit SPI buffer value.
24688  This operation is atomic.
24689  Precondition:
24690  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24691  Parameters:
24692  index - Identifier for the device instance to be configured
24693  Returns:
24694  Returns the SPI 32-bit buffer value.
24695  Example:
24696  <code>
24697 #define MY_SPI_INSTANCE SPI_ID_1
24698 
24699  uint32_t bufferValue = PLIB_SPI_BufferRead32bit( MY_SPI_INSTANCE );
24700  </code>
24701  Remarks:
24702  This function implements an operation of the buffer control feature.
24703  This feature may not be available on all devices. Please refer to the
24704  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
24705  in your application to automatically determine whether this feature is available.
24706  */
24707 
24708 uint32_t
24710  SPI_MODULE_ID index ) ;
24711 //******************************************************************************
24712 /* Function:
24713  void PLIB_SPI_BufferWrite ( SPI_MODULE_ID index , uint8_t data )
24714  Summary:
24715  Write the data to the SPI buffer.
24716  Description:
24717  This function writes data to the SPI buffer.
24718  This operation is atomic.
24719  Precondition:
24720  None.
24721  Parameters:
24722  index - Identifier for the device instance to be configured
24723  data - Data to written to the SPI buffer
24724  Returns:
24725  None.
24726  Example:
24727  <code>
24728  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24729  // application developer.
24730  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0xFF );
24731  </code>
24732  Remarks:
24733  This function implements an operation of the buffer control feature.
24734  This feature may not be available on all devices. Please refer to the
24735  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24736  in your application to automatically determine whether this feature is available.
24737  */
24738 
24739 void
24741  SPI_MODULE_ID index ,
24742  uint8_t data ) ;
24743 //******************************************************************************
24744 /* Function:
24745  void PLIB_SPI_BufferWrite16bit ( SPI_MODULE_ID index , uint16_t data )
24746  Summary:
24747  Writes 16-bit data to the SPI buffer.
24748  Description:
24749  This function writes 16-bit data to the SPI buffer.
24750  This operation is atomic.
24751  Precondition:
24752  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24753  Parameters:
24754  index - Identifier for the device instance to be configured
24755  data - 16-bit data to be written to the SPI buffer
24756  Returns:
24757  None.
24758  Example:
24759  <code>
24760 #define MY_SPI_INSTANCE SPI_ID_1
24761 
24762  PLIB_SPI_BufferWrite16bit ( MY_SPI_INSTANCE, 0x55AA );
24763  </code>
24764  Remarks:
24765  This function implements an operation of the buffer control feature.
24766  This feature may not be available on all devices. Please refer to the
24767  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
24768  in your application to automatically determine whether this feature is available.
24769  */
24770 
24771 void
24773  SPI_MODULE_ID index ,
24774  uint16_t data ) ;
24775 //******************************************************************************
24776 /* Function:
24777  void PLIB_SPI_BufferWrite32bit ( SPI_MODULE_ID index , uint32_t data )
24778  Summary:
24779  Write 32-bit data to the SPI buffer.
24780  Description:
24781  This function writes 32-bit data to the SPI buffer.
24782  This operation is atomic.
24783  Precondition:
24784  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24785  Parameters:
24786  index - Identifier for the device instance to be configured
24787  data - 32-bit data to be written to the SPI buffer
24788  Returns:
24789  None.
24790  Example:
24791  <code>
24792 #define MY_SPI_INSTANCE SPI_ID_1
24793 
24794  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0x55AA55AA );
24795  </code>
24796  Remarks:
24797  This function implements an operation of the buffer control feature.
24798  This feature may not be available on all devices. Please refer to the
24799  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
24800  in your application to automatically determine whether this feature is available.
24801  */
24802 
24803 void
24805  SPI_MODULE_ID index ,
24806  uint32_t data ) ;
24807 //******************************************************************************
24808 /* Function : PLIB_SPI_BufferAddressGet( SPI_MODULE_ID index )
24809  Summary:
24810  Returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive (SPIxRXB))
24811  register.
24812  Description:
24813  This function returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive
24814  (SPIxRXB)) register.
24815  This operation is atomic.
24816  Preconditions:
24817  None.
24818  Parameters:
24819  index - Identifier for the device instance
24820  Returns:
24821  The address of the SPIxBUF register
24822  Remarks:
24823  None.
24824 */
24825 
24826 void *
24828  SPI_MODULE_ID index ) ;
24829 //******************************************************************************
24830 /* Function:
24831  void PLIB_SPI_BaudRateClockSelect (SPI_MODULE_ID index,
24832  SPI_BAUD_RATE_CLOCK type)
24833  Summary:
24834  Selects the type of clock is used by the Baud Rate Generator.
24835  Description:
24836  This function selects the type of clock is used by the Baud Rate Generator.
24837  Precondition:
24838  None.
24839  Parameters:
24840  index - Identifier for the device instance to be configured
24841  type - One of the SPI_BAUD_RATE_CLOCK enumeration values as the SPI baud clock
24842  Returns:
24843  None.
24844  Example:
24845  <code>
24846  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24847  // application developer.
24848  PLIB_SPI_BaudRateClockSelect (MY_SPI_INSTANCE, SPI_BAUD_RATE_MCLK_CLOCK);
24849  </code>
24850  Remarks:
24851  This function implements an operation of the baud rate clock control feature.
24852  This feature may not be available on all devices. Please refer to the
24853  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRateClock"
24854  in your application to automatically determine whether this feature is available.
24855  */
24856 
24857 void
24859  SPI_MODULE_ID index ,
24860  SPI_BAUD_RATE_CLOCK type ) ;
24861 //******************************************************************************
24862 /* Function:
24863  void PLIB_SPI_ErrorInterruptEnable (SPI_MODULE_ID index,
24864  SPI_ERROR_INTERRUPT error)
24865  Summary:
24866  Enables SPI error interrupts
24867  Description:
24868  This function enables SPI error interrupts.
24869  Precondition:
24870  None.
24871  Parameters:
24872  index - Identifier for the device instance to be configured
24873  type - One of the SPI_ERROR_INTERRUPT enumeration values as the
24874  SPI interrupt error
24875  Returns:
24876  None.
24877  Example:
24878  <code>
24879  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24880  // application developer.
24881  PLIB_SPI_ErrorInterruptEnable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
24882  </code>
24883  Remarks:
24884  This function implements an operation of the error interrupt control feature.
24885  This feature may not be available on all devices. Please refer to the
24886  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
24887  in your application to automatically determine whether this feature is available.
24888  */
24889 
24890 void
24892  SPI_MODULE_ID index ,
24893  SPI_ERROR_INTERRUPT error ) ;
24894 //******************************************************************************
24895 /* Function:
24896  void PLIB_SPI_ErrorInterruptDisable (SPI_MODULE_ID index,
24897  SPI_ERROR_INTERRUPT error)
24898  Summary:
24899  Enables SPI error interrupts.
24900  Description:
24901  This function enables SPI error interrupts.
24902  Precondition:
24903  None.
24904  Parameters:
24905  index - Identifier for the device instance to be configured
24906  error - One of the SPI_ERROR_INTERRUPT enumeration values as the
24907  SPI interrupt error
24908  Returns:
24909  None.
24910  Example:
24911  <code>
24912  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24913  // application developer.
24914  PLIB_SPI_ErrorInterruptDisable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
24915  </code>
24916  Remarks:
24917  This function implements an operation of the error interrupt control feature.
24918  This feature may not be available on all devices. Please refer to the
24919  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
24920  in your application to automatically determine whether this feature is available.
24921  */
24922 
24923 void
24925  SPI_MODULE_ID index ,
24926  SPI_ERROR_INTERRUPT error ) ;
24927 //******************************************************************************
24928 /* Function:
24929  void PLIB_SPI_AudioErrorEnable (SPI_MODULE_ID index, SPI_Audio_ERROR error)
24930  Summary:
24931  Enables the SPI error.
24932  Description:
24933  This function enables the SPI error.
24934  This operation is atomic.
24935  Precondition:
24936  None.
24937  Parameters:
24938  index - Identifier for the device instance to be configured
24939  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
24940  Returns:
24941  None.
24942  Example:
24943  <code>
24944  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24945  // application developer.
24946  PLIB_SPI_AudioErrorEnable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
24947  </code>
24948  Remarks:
24949  This function implements an operation of the audio error control feature.
24950  This feature may not be available on all devices. Please refer to the
24951  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
24952  in your application to automatically determine whether this feature is available.
24953  */
24954 
24955 void
24957  SPI_MODULE_ID index ,
24958  SPI_AUDIO_ERROR error ) ;
24959 //******************************************************************************
24960 /* Function:
24961  void PLIB_SPI_AudioErrorDisable (SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
24962  Summary:
24963  Disables the SPI error.
24964  Description:
24965  This function disables the SPI error.
24966  This operation is atomic.
24967  Precondition:
24968  None.
24969  Parameters:
24970  index - Identifier for the device instance to be configured
24971  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
24972  Returns:
24973  None.
24974  Example:
24975  <code>
24976  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24977  // application developer.
24978  PLIB_SPI_AudioErrorDisable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
24979  </code>
24980  Remarks:
24981  This function implements an operation of the audio error control feature.
24982  This feature may not be available on all devices. Please refer to the
24983  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
24984  in your application to automatically determine whether this feature is available.
24985  */
24986 
24987 void
24989  SPI_MODULE_ID index ,
24990  SPI_AUDIO_ERROR error ) ;
24991 //******************************************************************************
24992 /* Function:
24993  void PLIB_SPI_AudioProtocolEnable (SPI_MODULE_ID index)
24994  Summary:
24995  Audio protocol is enabled.
24996  Description:
24997  This function enables the audio protocol.
24998  This operation is atomic.
24999  Precondition:
25000  Disable the SPI module by calling PLIB_SPI_Disable.
25001  Parameters:
25002  index - Identifier for the device instance to be configured
25003  Returns:
25004  None.
25005  Example:
25006  <code>
25007  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25008  // application developer.
25009  PLIB_SPI_AudioProtocolEnable(MY_SPI_INSTANCE);
25010  </code>
25011  Remarks:
25012  This function implements an operation of the audio protocol control feature.
25013  This feature may not be available on all devices. Please refer to the
25014  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25015  in your application to automatically determine whether this feature is available.
25016  */
25017 
25018 void
25020  SPI_MODULE_ID index ) ;
25021 //******************************************************************************
25022 /* Function:
25023  void PLIB_SPI_AudioProtocolDisable (SPI_MODULE_ID index)
25024  Summary:
25025  Audio protocol is disabled.
25026  Description:
25027  This function disables the audio protocol.
25028  This operation is atomic.
25029  Precondition:
25030  None.
25031  Parameters:
25032  index - Identifier for the device instance to be configured
25033  Returns:
25034  None.
25035  Example:
25036  <code>
25037  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25038  // application developer.
25039  PLIB_SPI_AudioProtocolDisable(MY_SPI_INSTANCE);
25040  </code>
25041  Remarks:
25042  This function implements an operation of the audio protocol control feature.
25043  This feature may not be available on all devices. Please refer to the
25044  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25045  in your application to automatically determine whether this feature is available.
25046  */
25047 
25048 void
25050  SPI_MODULE_ID index ) ;
25051 //******************************************************************************
25052 /* Function:
25053  void PLIB_SPI_AudioTransmitModeSelect (SPI_MODULE_ID index,
25054  SPI_AUDIO_TRANSMIT_MODE mode)
25055  Summary:
25056  Selects the transmit audio data format.
25057  Description:
25058  This function selects the transmit audio data format.
25059  Precondition:
25060  None.
25061  Parameters:
25062  index - Identifier for the device instance to be configured
25063  mode - One of the SPI_TRANSMIT_AUDIO_MODE enumeration values as the
25064  transmit audio format
25065  Returns:
25066  None.
25067  Example:
25068  <code>
25069  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25070  // application developer.
25071  PLIB_SPI_AudioTransmitModeSelect (MY_SPI_INSTANCE, SPI_AUDIO_TRANSMIT_MONO);
25072  </code>
25073  Remarks:
25074  This function implements an operation of the audio transmit mode feature.
25075  This feature may not be available on all devices. Please refer to the
25076  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioTransmitMode"
25077  in your application to automatically determine whether this feature is available.
25078  */
25079 
25080 void
25082  SPI_MODULE_ID index ,
25083  SPI_AUDIO_TRANSMIT_MODE mode ) ;
25084 //******************************************************************************
25085 /* Function:
25086  void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index,
25087  SPI_AUDIO_PROTOCOL mode )
25088  Summary:
25089  Selects the Audio Protocol mode.
25090  Description:
25091  This function selects the Audio Protocol mode.
25092  Precondition:
25093  None.
25094  Parameters:
25095  index - Identifier for the device instance to be configured
25096  mode - One of the SPI_AUDIO_PROTOCOL enumeration values as the
25097  audio protocol
25098  Returns:
25099  None.
25100  Example:
25101  <code>
25102  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25103  // application developer.
25104  PLIB_SPI_AudioProtocolModeSelect(MY_SPI_INSTANCE,SPI_AUDIO_PROTOCOL_RIGHT_JUSTIFIED );
25105  </code>
25106  Remarks:
25107  This function implements an operation of the audio protocol mode feature.
25108  This feature may not be available on all devices. Please refer to the
25109  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolMode"
25110  in your application to automatically determine whether this feature is available.
25111  */
25112 
25113 void
25115  SPI_MODULE_ID index ,
25116  SPI_AUDIO_PROTOCOL mode ) ;
25117 // *****************************************************************************
25118 // *****************************************************************************
25119 // Section: SPI Peripheral Library Exists Functions
25120 // *****************************************************************************
25121 // *****************************************************************************
25122 /* The following functions indicate the existence of the features on the device.
25123 */
25124 //******************************************************************************
25125 /* Function:
25126  PLIB_SPI_ExistsEnableControl( SPI_MODULE_ID index )
25127  Summary:
25128  Identifies whether the EnableControl feature exists on the SPI module.
25129  Description:
25130  This function identifies whether the EnableControl feature is available on
25131  the SPI module.
25132  When this function returns true, these functions are supported on the device:
25133  - PLIB_SPI_Enable
25134  - PLIB_SPI_Disable
25135  This operation is atomic.
25136  Preconditions:
25137  None.
25138  Parameters:
25139  index - Identifier for the device instance
25140  Returns:
25141  - true - The EnableControl feature is supported on the device
25142  - false - The EnableControl feature is not supported on the device
25143  Remarks:
25144  None.
25145 */
25146 
25147 bool
25149  SPI_MODULE_ID index ) ;
25150 //******************************************************************************
25151 /* Function:
25152  PLIB_SPI_ExistsStopInIdleControl( SPI_MODULE_ID index )
25153  Summary:
25154  Identifies whether the StopInIdle feature exists on the SPI module.
25155  Description:
25156  This function identifies whether the StopInIdle feature is available on the
25157  SPI module.
25158  When this function returns true, these functions are supported on the device:
25159  - PLIB_SPI_StopInIdleEnable
25160  - PLIB_SPI_StopInIdleDisable
25161  This operation is atomic.
25162  Preconditions:
25163  None.
25164  Parameters:
25165  index - Identifier for the device instance
25166  Returns:
25167  - true - The StopInIdle feature is supported on the device
25168  - false - The StopInIdle feature is not supported on the device
25169  Remarks:
25170  None.
25171 */
25172 
25173 bool
25175  SPI_MODULE_ID index ) ;
25176 //******************************************************************************
25177 /* Function:
25178  PLIB_SPI_ExistsReceiverOverflow( SPI_MODULE_ID index )
25179  Summary:
25180  Identifies whether the ReceiverOverflow feature exists on the SPI module.
25181  Description:
25182  This function identifies whether the ReceiverOverflow feature is available
25183  on the SPI module.
25184  When this function returns true, these functions are supported on the device:
25185  - PLIB_SPI_ReceiverHasOverflowed
25186  - PLIB_SPI_ReceiverOverflowClear
25187  This operation is atomic.
25188  Preconditions:
25189  None.
25190  Parameters:
25191  index - Identifier for the device instance
25192  Returns:
25193  - true - The ReceiverOverflow feature is supported on the device
25194  - false - The ReceiverOverflow feature is not supported on the device
25195  Remarks:
25196  None.
25197 */
25198 
25199 bool
25201  SPI_MODULE_ID index ) ;
25202 //******************************************************************************
25203 /* Function:
25204  PLIB_SPI_ExistsTransmitBufferFullStatus( SPI_MODULE_ID index )
25205  Summary:
25206  Identifies whether the TransmitBufferFullStatus feature exists on the SPI module.
25207  Description:
25208  This function identifies whether the TransmitBufferFullStatus feature is available
25209  on the SPI module.
25210  When this function returns true, this function is supported on the device:
25211  - PLIB_SPI_TransmitBufferIsFull
25212  This operation is atomic.
25213  Preconditions:
25214  None.
25215  Parameters:
25216  index - Identifier for the device instance
25217  Returns:
25218  - true - The TransmitBufferFullStatus feature is supported on the device
25219  - false - The TransmitBufferFullStatus feature is not supported on the device
25220  Remarks:
25221  None.
25222 */
25223 
25224 bool
25226  SPI_MODULE_ID index ) ;
25227 //******************************************************************************
25228 /* Function:
25229  PLIB_SPI_ExistsTransmitBufferEmptyStatus( SPI_MODULE_ID index )
25230  Summary:
25231  Identifies whether the TransmitBufferEmptyStatus feature exists on the SPI module.
25232  Description:
25233  This function identifies whether the TransmitBufferEmptyStatus feature is available
25234  on the SPI module.
25235  When this function returns true, this function is supported on the device:
25236  - PLIB_SPI_TransmitBufferIsEmpty
25237  This operation is atomic.
25238  Preconditions:
25239  None.
25240  Parameters:
25241  index - Identifier for the device instance
25242  Returns:
25243  - true - The TransmitBufferEmptyStatus feature is supported on the device
25244  - false - The TransmitBufferEmptyStatus feature is not supported on the device
25245  Remarks:
25246  None.
25247 */
25248 
25249 bool
25251  SPI_MODULE_ID index ) ;
25252 //******************************************************************************
25253 /* Function:
25254  PLIB_SPI_ExistsReceiveBufferStatus( SPI_MODULE_ID index )
25255  Summary:
25256  Identifies whether the ReceiveBufferStatus feature exists on the SPI module.
25257  Description:
25258  This function identifies whether the ReceiveBufferStatus feature is available
25259  on the SPI module.
25260  When this function returns true, this function is supported on the device:
25261  - PLIB_SPI_ReceiverBufferIsFull
25262  This operation is atomic.
25263  Preconditions:
25264  None.
25265  Parameters:
25266  index - Identifier for the device instance
25267  Returns:
25268  - true - The ReceiveBufferStatus feature is supported on the device
25269  - false - The ReceiveBufferStatus feature is not supported on the device
25270  Remarks:
25271  None.
25272 */
25273 
25274 bool
25276  SPI_MODULE_ID index ) ;
25277 //******************************************************************************
25278 /* Function:
25279  PLIB_SPI_ExistsPinControl( SPI_MODULE_ID index )
25280  Summary:
25281  Identifies whether the PinControl feature exists on the SPI module.
25282  Description:
25283  This function identifies whether the PinControl feature is available on the
25284  SPI module.
25285  When this function returns true, these functions are supported on the device:
25286  - PLIB_SPI_PinEnable
25287  - PLIB_SPI_PinDisable
25288  This operation is atomic.
25289  Preconditions:
25290  None.
25291  Parameters:
25292  index - Identifier for the device instance
25293  Returns:
25294  - true - The PinControl feature is supported on the device
25295  - false - The PinControl feature is not supported on the device
25296  Remarks:
25297  None.
25298 */
25299 
25300 bool
25302  SPI_MODULE_ID index ) ;
25303 //******************************************************************************
25304 /* Function:
25305  PLIB_SPI_ExistsCommunicationWidth( SPI_MODULE_ID index )
25306  Summary:
25307  Identifies whether the CommunicationWidth feature exists on the SPI module.
25308  Description:
25309  This function identifies whether the CommunicationWidth feature is available
25310  on the SPI module.
25311  When this function returns true, this function is supported on the device:
25312  - PLIB_SPI_CommunicationWidthSelect
25313  This operation is atomic.
25314  Preconditions:
25315  None.
25316  Parameters:
25317  index - Identifier for the device instance
25318  Returns:
25319  - true - The CommunicationWidth feature is supported on the device
25320  - false - The CommunicationWidth feature is not supported on the device
25321  Remarks:
25322  None.
25323 */
25324 
25325 bool
25327  SPI_MODULE_ID index ) ;
25328 //******************************************************************************
25329 /* Function:
25330  PLIB_SPI_ExistsAudioCommunicationWidth( SPI_MODULE_ID index )
25331  Summary:
25332  Identifies whether the AudioCommunicationWidth feature exists on the SPI module.
25333  Description:
25334  This function identifies whether the AudioCommunicationWidth feature is available
25335  on the SPI module.
25336  When this function returns true, this function is supported on the device:
25337  - PLIB_SPI_AudioCommunicationWidthSelect
25338  This operation is atomic.
25339  Preconditions:
25340  None.
25341  Parameters:
25342  index - Identifier for the device instance
25343  Returns:
25344  - true - The AudioCommunicationWidth feature is supported on the device
25345  - false - The AudioCommunicationWidth feature is not supported on the device
25346  Remarks:
25347  None.
25348 */
25349 
25350 bool
25352  SPI_MODULE_ID index ) ;
25353 //******************************************************************************
25354 /* Function:
25355  PLIB_SPI_ExistsInputSamplePhase( SPI_MODULE_ID index )
25356  Summary:
25357  Identifies whether the InputSamplePhase feature exists on the SPI module.
25358  Description:
25359  This function identifies whether the InputSamplePhase feature is available
25360  on the SPI module.
25361  When this function returns true, this function is supported on the device:
25362  - PLIB_SPI_InputSamplePhaseSelect
25363  This operation is atomic.
25364  Preconditions:
25365  None.
25366  Parameters:
25367  index - Identifier for the device instance
25368  Returns:
25369  - true - The InputSamplePhase feature is supported on the device
25370  - false - The InputSamplePhase feature is not supported on the device
25371  Remarks:
25372  None.
25373 */
25374 
25375 bool
25377  SPI_MODULE_ID index ) ;
25378 //******************************************************************************
25379 /* Function:
25380  PLIB_SPI_ExistsOutputDataPhase( SPI_MODULE_ID index )
25381  Summary:
25382  Identifies whether the OutputDataPhase feature exists on the SPI module.
25383  Description:
25384  This function identifies whether the OutputDataPhase feature is available on
25385  the SPI module.
25386  When this function returns true, this function is supported on the device:
25387  - PLIB_SPI_OutputDataPhaseSelect
25388  This operation is atomic.
25389  Preconditions:
25390  None.
25391  Parameters:
25392  index - Identifier for the device instance
25393  Returns:
25394  - true - The OutputDataPhase feature is supported on the device
25395  - false - The OutputDataPhase feature is not supported on the device
25396  Remarks:
25397  None.
25398 */
25399 
25400 bool
25402  SPI_MODULE_ID index ) ;
25403 //******************************************************************************
25404 /* Function:
25405  PLIB_SPI_ExistsClockPolarity( SPI_MODULE_ID index )
25406  Summary:
25407  Identifies whether the ClockPolarity feature exists on the SPI module.
25408  Description:
25409  This function identifies whether the ClockPolarity feature is available on
25410  the SPI module.
25411  When this function returns true, this function is supported on the device:
25412  - PLIB_SPI_ClockPolaritySelect
25413  This operation is atomic.
25414  Preconditions:
25415  None.
25416  Parameters:
25417  index - Identifier for the device instance
25418  Returns:
25419  - true - The ClockPolarity feature is supported on the device
25420  - false - The ClockPolarity feature is not supported on the device
25421  Remarks:
25422  None.
25423 */
25424 
25425 bool
25427  SPI_MODULE_ID index ) ;
25428 //******************************************************************************
25429 /* Function:
25430  PLIB_SPI_ExistsMasterControl( SPI_MODULE_ID index )
25431  Summary:
25432  Identifies whether the MasterControl feature exists on the SPI module.
25433  Description:
25434  This function identifies whether the MasterControl feature is available on
25435  the SPI module.
25436  When this function returns true, these functions are supported on the device:
25437  - PLIB_SPI_MasterEnable
25438  - PLIB_SPI_SlaveEnable
25439  This operation is atomic.
25440  Preconditions:
25441  None.
25442  Parameters:
25443  index - Identifier for the device instance
25444  Returns:
25445  - true - The MasterControl feature is supported on the device
25446  - false - The MasterControl feature is not supported on the device
25447  Remarks:
25448  None.
25449 */
25450 
25451 bool
25453  SPI_MODULE_ID index ) ;
25454 //******************************************************************************
25455 /* Function:
25456  PLIB_SPI_ExistsBaudRate( SPI_MODULE_ID index )
25457  Summary:
25458  Identifies whether the BaudRate feature exists on the SPI module.
25459  Description:
25460  This function identifies whether the BaudRate feature is available on the SPI
25461  module.
25462  When this function returns true, this function is supported on the device:
25463  - PLIB_SPI_BaudRateSet
25464  This operation is atomic.
25465  Preconditions:
25466  None.
25467  Parameters:
25468  index - Identifier for the device instance
25469  Returns:
25470  - true - The BaudRate feature is supported on the device
25471  - false - The BaudRate feature is not supported on the device
25472  Remarks:
25473  None.
25474 */
25475 
25476 bool
25478  SPI_MODULE_ID index ) ;
25479 //******************************************************************************
25480 /* Function:
25481  PLIB_SPI_ExistsBusStatus( SPI_MODULE_ID index )
25482  Summary:
25483  Identifies whether the BusStatus feature exists on the SPI module.
25484  Description:
25485  This function identifies whether the BusStatus feature is available on the
25486  SPI module.
25487  When this function returns true, this function is supported on the device:
25488  - PLIB_SPI_IsBusy
25489  This operation is atomic.
25490  Preconditions:
25491  None.
25492  Parameters:
25493  index - Identifier for the device instance
25494  Returns:
25495  - true - The BusStatus feature is supported on the device
25496  - false - The BusStatus feature is not supported on the device
25497  Remarks:
25498  None.
25499 */
25500 
25501 bool
25503  SPI_MODULE_ID index ) ;
25504 //******************************************************************************
25505 /* Function:
25506  PLIB_SPI_ExistsReadDataSignStatus( SPI_MODULE_ID index )
25507  Summary:
25508  Identifies whether the ReadDataSignStatus feature exists on the SPI module.
25509  Description:
25510  This function identifies whether the ReadDataSignStatus feature is available
25511  on the SPI module.
25512  When this function returns true, this function is supported on the device:
25513  - PLIB_SPI_ReadDataIsSignExtended
25514  This operation is atomic.
25515  Preconditions:
25516  None.
25517  Parameters:
25518  index - Identifier for the device instance
25519  Returns:
25520  - true - The ReadDataSignStatus feature is supported on the device
25521  - false - The ReadDataSignStatus feature is not supported on the device
25522  Remarks:
25523  None.
25524 */
25525 
25526 bool
25528  SPI_MODULE_ID index ) ;
25529 //******************************************************************************
25530 /* Function:
25531  PLIB_SPI_ExistsSlaveSelectControl( SPI_MODULE_ID index )
25532  Summary:
25533  Identifies whether the SlaveSelectControl feature exists on the SPI module.
25534  Description:
25535  This function identifies whether the SlaveSelectControl feature is available
25536  on the SPI module.
25537  When this function returns true, these functions are supported on the device:
25538  - PLIB_SPI_SlaveSelectEnable
25539  - PLIB_SPI_SlaveSelectDisable
25540  This operation is atomic.
25541  Preconditions:
25542  None.
25543  Parameters:
25544  index - Identifier for the device instance
25545  Returns:
25546  - true - The SlaveSelectControl feature is supported on the device
25547  - false - The SlaveSelectControl feature is not supported on the device
25548  Remarks:
25549  None.
25550 */
25551 
25552 bool
25554  SPI_MODULE_ID index ) ;
25555 //******************************************************************************
25556 /* Function:
25557  PLIB_SPI_ExistsTransmitUnderRunStatus( SPI_MODULE_ID index )
25558  Summary:
25559  Identifies whether the TransmitUnderRunStatus feature exists on the SPI module.
25560  Description:
25561  This function identifies whether the TransmitUnderRunStatus feature is available
25562  on the SPI module.
25563  When this function returns true, these functions are supported on the device:
25564  - PLIB_SPI_TransmitUnderRunStatusGet
25565  - PLIB_SPI_TransmitUnderRunStatusClear
25566  This operation is atomic.
25567  Preconditions:
25568  None.
25569  Parameters:
25570  index - Identifier for the device instance
25571  Returns:
25572  - true - The TransmitUnderRunStatus feature is supported on the device
25573  - false - The TransmitUnderRunStatus feature is not supported on the device
25574  Remarks:
25575  None.
25576 */
25577 
25578 bool
25580  SPI_MODULE_ID index ) ;
25581 //******************************************************************************
25582 /* Function:
25583  PLIB_SPI_ExistsFIFOControl( SPI_MODULE_ID index )
25584  Summary:
25585  Identifies whether the FIFOControl feature exists on the SPI module.
25586  Description:
25587  This function identifies whether the FIFOControl feature is available on the
25588  SPI module.
25589  When this function returns true, these functions are supported on the device:
25590  - PLIB_SPI_FIFOEnable
25591  - PLIB_SPI_FIFODisable
25592  This operation is atomic.
25593  Preconditions:
25594  None.
25595  Parameters:
25596  index - Identifier for the device instance
25597  Returns:
25598  - true - The FIFOControl feature is supported on the device
25599  - false - The FIFOControl feature is not supported on the device
25600  Remarks:
25601  None.
25602 */
25603 
25604 bool
25606  SPI_MODULE_ID index ) ;
25607 //******************************************************************************
25608 /* Function:
25609  PLIB_SPI_ExistsFIFOCount( SPI_MODULE_ID index )
25610  Summary:
25611  Identifies whether the FIFOCount feature exists on the SPI module.
25612  Description:
25613  This function identifies whether the FIFOCount feature is available on the SPI module.
25614  When this function returns true, this function is supported on the device:
25615  - PLIB_SPI_FIFOCountGet
25616  This operation is atomic.
25617  Preconditions:
25618  None.
25619  Parameters:
25620  index - Identifier for the device instance
25621  Returns:
25622  - true - The FIFOCount feature is supported on the device
25623  - false - The FIFOCount feature is not supported on the device
25624  Remarks:
25625  None.
25626 */
25627 
25628 bool
25630  SPI_MODULE_ID index ) ;
25631 //******************************************************************************
25632 /* Function:
25633  PLIB_SPI_ExistsReceiveFIFOStatus( SPI_MODULE_ID index )
25634  Summary:
25635  Identifies whether the ReceiveFIFOStatus feature exists on the SPI module.
25636  Description:
25637  This function identifies whether the ReceiveFIFOStatus feature is available
25638  on the SPI module.
25639  When this function returns true, this function is supported on the device:
25640  - PLIB_SPI_ReceiverFIFOIsEmpty
25641  This operation is atomic.
25642  Preconditions:
25643  None.
25644  Parameters:
25645  index - Identifier for the device instance
25646  Returns:
25647  - true - The ReceiveFIFOStatus feature is supported on the device
25648  - false - The ReceiveFIFOStatus feature is not supported on the device
25649  Remarks:
25650  None.
25651 */
25652 
25653 bool
25655  SPI_MODULE_ID index ) ;
25656 //******************************************************************************
25657 /* Function:
25658  PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus( SPI_MODULE_ID index )
25659  Summary:
25660  Identifies whether the FIFOShiftRegisterEmptyStatus feature exists on the SPI module.
25661  Description:
25662  This function identifies whether the FIFOShiftRegisterEmptyStatus feature is
25663  available on the SPI module.
25664  When this function returns true, this function is supported on the device:
25665  - PLIB_SPI_FIFOShiftRegisterIsEmpty
25666  This operation is atomic.
25667  Preconditions:
25668  None.
25669  Parameters:
25670  index - Identifier for the device instance
25671  Returns:
25672  - true - The FIFOShiftRegisterEmptyStatus feature is supported on the device
25673  - false - The FIFOShiftRegisterEmptyStatus feature is not supported on the device
25674  Remarks:
25675  None.
25676 */
25677 
25678 bool
25680  SPI_MODULE_ID index ) ;
25681 //******************************************************************************
25682 /* Function:
25683  PLIB_SPI_ExistsFIFOInterruptMode( SPI_MODULE_ID index )
25684  Summary:
25685  Identifies whether the FIFOInterruptMode feature exists on the SPI module.
25686  Description:
25687  This function identifies whether the FIFOInterruptMode feature is available
25688  on the SPI module.
25689  When this function returns true, this function is supported on the device:
25690  - PLIB_SPI_FIFOInterruptModeSelect
25691  This operation is atomic.
25692  Preconditions:
25693  None.
25694  Parameters:
25695  index - Identifier for the device instance
25696  Returns:
25697  - true - The FIFOInterruptMode feature is supported on the device
25698  - false - The FIFOInterruptMode feature is not supported on the device
25699  Remarks:
25700  None.
25701 */
25702 
25703 bool
25705  SPI_MODULE_ID index ) ;
25706 //******************************************************************************
25707 /* Function:
25708  PLIB_SPI_ExistsFramedCommunication( SPI_MODULE_ID index )
25709  Summary:
25710  Identifies whether the FramedCommunication feature exists on the SPI module.
25711  Description:
25712  This function identifies whether the FramedCommunication feature is available
25713  on the SPI module.
25714  When this function returns true, these functions are supported on the device:
25715  - PLIB_SPI_FramedCommunicationEnable
25716  - PLIB_SPI_FramedCommunicationDisable
25717  This operation is atomic.
25718  Preconditions:
25719  None.
25720  Parameters:
25721  index - Identifier for the device instance
25722  Returns:
25723  - true - The FramedCommunication feature is supported on the device
25724  - false - The FramedCommunication feature is not supported on the device
25725  Remarks:
25726  None.
25727 */
25728 
25729 bool
25731  SPI_MODULE_ID index ) ;
25732 //******************************************************************************
25733 /* Function:
25734  PLIB_SPI_ExistsFrameSyncPulseDirection( SPI_MODULE_ID index )
25735  Summary:
25736  Identifies whether the FrameSyncPulseDirection feature exists on the SPI module.
25737  Description:
25738  This function identifies whether the FrameSyncPulseDirection feature is available
25739  on the SPI module.
25740  When this function returns true, this function is supported on the device:
25741  - PLIB_SPI_FrameSyncPulseDirectionSelect
25742  This operation is atomic.
25743  Preconditions:
25744  None.
25745  Parameters:
25746  index - Identifier for the device instance
25747  Returns:
25748  - true - The FrameSyncPulseDirection feature is supported on the device
25749  - false - The FrameSyncPulseDirection feature is not supported on the device
25750  Remarks:
25751  None.
25752 */
25753 
25754 bool
25756  SPI_MODULE_ID index ) ;
25757 //******************************************************************************
25758 /* Function:
25759  PLIB_SPI_ExistsFrameSyncPulsePolarity( SPI_MODULE_ID index )
25760  Summary:
25761  Identifies whether the FrameSyncPulsePolarity feature exists on the SPI module.
25762  Description:
25763  This function identifies whether the FrameSyncPulsePolarity feature is available
25764  on the SPI module.
25765  When this function returns true, this function is supported on the device:
25766  - PLIB_SPI_FrameSyncPulsePolaritySelect
25767  This operation is atomic.
25768  Preconditions:
25769  None.
25770  Parameters:
25771  index - Identifier for the device instance
25772  Returns:
25773  - true - The FrameSyncPulsePolarity feature is supported on the device
25774  - false - The FrameSyncPulsePolarity feature is not supported on the device
25775  Remarks:
25776  None.
25777 */
25778 
25779 bool
25781  SPI_MODULE_ID index ) ;
25782 //******************************************************************************
25783 /* Function:
25784  PLIB_SPI_ExistsFrameSyncPulseEdge( SPI_MODULE_ID index )
25785  Summary:
25786  Identifies whether the FrameSyncPulseEdge feature exists on the SPI module.
25787  Description:
25788  This function identifies whether the FrameSyncPulseEdge feature is available
25789  on the SPI module.
25790  When this function returns true, this function is supported on the device:
25791  - PLIB_SPI_FrameSyncPulseEdgeSelect
25792  This operation is atomic.
25793  Preconditions:
25794  None.
25795  Parameters:
25796  index - Identifier for the device instance
25797  Returns:
25798  - true - The FrameSyncPulseEdge feature is supported on the device
25799  - false - The FrameSyncPulseEdge feature is not supported on the device
25800  Remarks:
25801  None.
25802 */
25803 
25804 bool
25806  SPI_MODULE_ID index ) ;
25807 //******************************************************************************
25808 /* Function:
25809  PLIB_SPI_ExistsFrameSyncPulseWidth( SPI_MODULE_ID index )
25810  Summary:
25811  Identifies whether the FrameSyncPulseWidth feature exists on the SPI module.
25812  Description:
25813  This function identifies whether the FrameSyncPulseWidth feature is available
25814  on the SPI module.
25815  When this function returns true, this function is supported on the device:
25816  - PLIB_SPI_FrameSyncPulseWidthSelect
25817  This operation is atomic.
25818  Preconditions:
25819  None.
25820  Parameters:
25821  index - Identifier for the device instance
25822  Returns:
25823  - true - The FrameSyncPulseWidth feature is supported on the device
25824  - false - The FrameSyncPulseWidth feature is not supported on the device
25825  Remarks:
25826  None.
25827 */
25828 
25829 bool
25831  SPI_MODULE_ID index ) ;
25832 //******************************************************************************
25833 /* Function:
25834  PLIB_SPI_ExistsFrameSyncPulseCounter( SPI_MODULE_ID index )
25835  Summary:
25836  Identifies whether the FrameSyncPulseCounter feature exists on the SPI module.
25837  Description:
25838  This function identifies whether the FrameSyncPulseCounter feature is available
25839  on the SPI module.
25840  When this function returns true, this function is supported on the device:
25841  - PLIB_SPI_FrameSyncPulseCounterSelect
25842  This operation is atomic.
25843  Preconditions:
25844  None.
25845  Parameters:
25846  index - Identifier for the device instance
25847  Returns:
25848  - true - The FrameSyncPulseCounter feature is supported on the device
25849  - false - The FrameSyncPulseCounter feature is not supported on the device
25850  Remarks:
25851  None.
25852 */
25853 
25854 bool
25856  SPI_MODULE_ID index ) ;
25857 //******************************************************************************
25858 /* Function:
25859  PLIB_SPI_ExistsFrameErrorStatus( SPI_MODULE_ID index )
25860  Summary:
25861  Identifies whether the FrameErrorStatus feature exists on the SPI module.
25862  Description:
25863  This function identifies whether the FrameErrorStatus feature is available on
25864  the SPI module.
25865  When this function returns true, these functions are supported on the device:
25866  - PLIB_SPI_FrameErrorStatusGet
25867  - PLIB_SPI_FrameErrorStatusClear
25868  This operation is atomic.
25869  Preconditions:
25870  None.
25871  Parameters:
25872  index - Identifier for the device instance
25873  Returns:
25874  - true - The FrameErrorStatus feature is supported on the device
25875  - false - The FrameErrorStatus feature is not supported on the device
25876  Remarks:
25877  None.
25878 */
25879 
25880 bool
25882  SPI_MODULE_ID index ) ;
25883 //******************************************************************************
25884 /* Function:
25885  PLIB_SPI_ExistsBuffer( SPI_MODULE_ID index )
25886  Summary:
25887  Identifies whether the Buffer feature exists on the SPI module.
25888  Description:
25889  This function identifies whether the Buffer feature is available on the SPI module.
25890  When this function returns true, these functions are supported on the device:
25891  - PLIB_SPI_BufferClear
25892  - PLIB_SPI_BufferRead
25893  - PLIB_SPI_BufferWrite
25894  - PLIB_SPI_BufferAddressGet
25895  This operation is atomic.
25896  Preconditions:
25897  None.
25898  Parameters:
25899  index - Identifier for the device instance
25900  Returns:
25901  - true - The Buffer feature is supported on the device
25902  - false - The Buffer feature is not supported on the device
25903  Remarks:
25904  None.
25905 */
25906 
25907 bool
25909  SPI_MODULE_ID index ) ;
25910 //******************************************************************************
25911 /* Function:
25912  PLIB_SPI_ExistsBaudRateClock( SPI_MODULE_ID index )
25913  Summary:
25914  Identifies whether the BaudRateClock feature exists on the SPI module.
25915  Description:
25916  This function identifies whether the BaudRateClock feature is available on
25917  the SPI module.
25918  When this function returns true, this function is supported on the device:
25919  - PLIB_SPI_BaudRateClockSelect
25920  This operation is atomic.
25921  Preconditions:
25922  None.
25923  Parameters:
25924  index - Identifier for the device instance
25925  Returns:
25926  - true - The BaudRateClock feature is supported on the device
25927  - false - The BaudRateClock feature is not supported on the device
25928  Remarks:
25929  None.
25930 */
25931 
25932 bool
25934  SPI_MODULE_ID index ) ;
25935 //******************************************************************************
25936 /* Function:
25937  PLIB_SPI_ExistsErrorInterruptControl( SPI_MODULE_ID index )
25938  Summary:
25939  Identifies whether the ErrorInterruptControl feature exists on the SPI module.
25940  Description:
25941  This function identifies whether the ErrorInterruptControl feature is available
25942  on the SPI module.
25943  When this function returns true, these functions are supported on the device:
25944  - PLIB_SPI_ErrorInterruptEnable
25945  - PLIB_SPI_ErrorInterruptDisable
25946  This operation is atomic.
25947  Preconditions:
25948  None.
25949  Parameters:
25950  index - Identifier for the device instance
25951  Returns:
25952  - true - The ErrorInterruptControl feature is supported on the device
25953  - false - The ErrorInterruptControl feature is not supported on the device
25954  Remarks:
25955  None.
25956 */
25957 
25958 bool
25960  SPI_MODULE_ID index ) ;
25961 //******************************************************************************
25962 /* Function:
25963  PLIB_SPI_ExistsAudioErrorControl( SPI_MODULE_ID index )
25964  Summary:
25965  Identifies whether the AudioErrorControl feature exists on the SPI module.
25966  Description:
25967  This function identifies whether the AudioErrorControl feature is available
25968  on the SPI module.
25969  When this function returns true, these functions are supported on the device:
25970  - PLIB_SPI_AudioErrorEnable
25971  - PLIB_SPI_AudioErrorDisable
25972  This operation is atomic.
25973  Preconditions:
25974  None.
25975  Parameters:
25976  index - Identifier for the device instance
25977  Returns:
25978  - true - The AudioErrorControl feature is supported on the device
25979  - false - The AudioErrorControl feature is not supported on the device
25980  Remarks:
25981  None.
25982 */
25983 
25984 bool
25986  SPI_MODULE_ID index ) ;
25987 //******************************************************************************
25988 /* Function:
25989  PLIB_SPI_ExistsAudioProtocolControl( SPI_MODULE_ID index )
25990  Summary:
25991  Identifies whether the AudioProtocolControl feature exists on the SPI module.
25992  Description:
25993  This function identifies whether the AudioProtocolControl feature is available
25994  on the SPI module.
25995  When this function returns true, this function is supported on the device:
25996  - PLIB_SPI_AudioProtocolEnable
25997  - PLIB_SPI_AudioProtocolDisable
25998  This operation is atomic.
25999  Preconditions:
26000  None.
26001  Parameters:
26002  index - Identifier for the device instance
26003  Returns:
26004  - true - The AudioProtocolControl feature is supported on the device
26005  - false - The AudioProtocolControl feature is not supported on the device
26006  Remarks:
26007  None.
26008 */
26009 
26010 bool
26012  SPI_MODULE_ID index ) ;
26013 //******************************************************************************
26014 /* Function:
26015  PLIB_SPI_ExistsAudioTransmitMode( SPI_MODULE_ID index )
26016  Summary:
26017  Identifies whether the AudioTransmitMode feature exists on the SPI module.
26018  Description:
26019  This function identifies whether the AudioTransmitMode feature is available
26020  on the SPI module.
26021  When this function returns true, this function is supported on the device:
26022  - PLIB_SPI_AudioTransmitModeSelect
26023  This operation is atomic.
26024  Preconditions:
26025  None.
26026  Parameters:
26027  index - Identifier for the device instance
26028  Returns:
26029  - true - The AudioTransmitMode feature is supported on the device
26030  - false - The AudioTransmitMode feature is not supported on the device
26031  Remarks:
26032  None.
26033 */
26034 
26035 bool
26037  SPI_MODULE_ID index ) ;
26038 //******************************************************************************
26039 /* Function:
26040  PLIB_SPI_ExistsAudioProtocolMode( SPI_MODULE_ID index )
26041  Summary:
26042  Identifies whether the AudioProtocolMode feature exists on the SPI module.
26043  Description:
26044  This function identifies whether the AudioProtocolMode feature is available
26045  on the SPI module.
26046  When this function returns true, this function is supported on the device:
26047  - PLIB_SPI_AudioProtocolModeSelect
26048  This operation is atomic.
26049  Preconditions:
26050  None.
26051  Parameters:
26052  index - Identifier for the device instance
26053  Returns:
26054  - true - The AudioProtocolMode feature is supported on the device
26055  - false - The AudioProtocolMode feature is not supported on the device
26056  Remarks:
26057  None.
26058 */
26059 
26060 bool
26062  SPI_MODULE_ID index ) ;
26063 //******************************************************************************
26064 /* Function:
26065  PLIB_SPI_Exists32bitBuffer( SPI_MODULE_ID index )
26066  Summary:
26067  Identifies whether the Buffer32bit feature exists on the SPI module.
26068  Description:
26069  This function identifies whether the Buffer32bit feature is available on the
26070  SPI module.
26071  When this function returns true, these functions are supported on the device:
26072  - PLIB_SPI_BufferRead32bit
26073  - PLIB_SPI_BufferWrite32bit
26074  This operation is atomic.
26075  Preconditions:
26076  None.
26077  Parameters:
26078  index - Identifier for the device instance
26079  Returns:
26080  - true - The Buffer32bit feature is supported on the device
26081  - false - The Buffer32bit feature is not supported on the device
26082  Remarks:
26083  None.
26084 */
26085 
26086 bool
26088  SPI_MODULE_ID index ) ;
26089 //******************************************************************************
26090 /* Function:
26091  PLIB_SPI_Exists16bitBuffer( SPI_MODULE_ID index )
26092  Summary:
26093  Identifies whether the Buffer16bit feature exists on the SPI module.
26094  Description:
26095  This function identifies whether the Buffer16bit feature is available on the
26096  SPI module.
26097  When this function returns true, these functions are supported on the device:
26098  - PLIB_SPI_BufferRead16bit
26099  - PLIB_SPI_BufferWrite16bit
26100  This operation is atomic.
26101  Preconditions:
26102  None.
26103  Parameters:
26104  index - Identifier for the device instance
26105  Returns:
26106  - true - The Buffer16bit feature is supported on the device
26107  - false - The Buffer16bit feature is not supported on the device
26108  Remarks:
26109  None.
26110 */
26111 
26112 bool
26114  SPI_MODULE_ID index ) ;
26115 //DOM-IGNORE-BEGIN
26116 //DOM-IGNORE-END
26117  // #ifndef _PLIB_SPI_H
26118 /*******************************************************************************
26119  End of File
26120  */
26121 
26122 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h*/
26123 /* CLOSE_FILE Include File */
26124 
26125  // SPI PLIB Header
26126 #include "system/common/sys_common.h" // Common System Service Definitions
26127 #include "system/common/sys_module.h" // Module/Driver Definitions
26128 #include "system/int/sys_int.h" // System Interrupt Definitions
26129 #include "system/clk/sys_clk.h"
26130 #include "C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h"
26131  /* LDRA full path */
26132 // DOM-IGNORE-BEGIN
26133 // DOM-IGNORE-END
26134 // *****************************************************************************
26135 /* SPI Driver Buffer Handle
26136  Summary:
26137  Handle identifying a read or write buffer passed to the driver.
26138  Description:
26139  A buffer handle value is returned by a call to the DRV_SPI_BufferAddRead()/
26140  DRV_SPI_BufferAddWrite or DRV_SPI_BufferAddReadWrite() functions.
26141  This handle is associated with the buffer passed into the function and
26142  it allows the application to track the completion of the data from (or into)
26143  that buffer. The buffer handle value returned from the "buffer add" function
26144  is returned back to the client by the "callback" function registered with
26145  the driver.
26146  The buffer handle assigned to a client request expires when the client has
26147  been notified of the completion of the buffer transfer (after event handler
26148  function that notifies the client returns) or after the buffer has been
26149  retired by the driver if no event handler callback was set.
26150  Remarks:
26151  None.
26152 */
26153 
26154 typedef
26155 uintptr_t
26157 // *****************************************************************************
26158 /* SPI Driver Invalid Buffer Handle
26159  Summary:
26160  Definition of an invalid buffer handle.
26161  Description:
26162  This is the definition of an invalid buffer handle. An invalid buffer handle
26163  is returned by DRV_SPI_BufferAddRead() and DRV_SPI_BufferAddWrite()
26164  function if the buffer add request was not successful.
26165  Remarks:
26166  None.
26167 */
26168 #define DRV_SPI_BUFFER_HANDLE_INVALID ( ( DRV_SPI_BUFFER_HANDLE ) ( - 1 ) )
26169 // *****************************************************************************
26170 /* SPI Driver Module Index Numbers
26171  Summary:
26172  SPI driver index definitions.
26173  Description:
26174  These constants provide the SPI driver index definitions.
26175  Remarks:
26176  These constants should be used in place of hard-coded numeric literals.
26177  These values should be passed into the DRV_SPI_Initialize and
26178  DRV_SPI_Open functions to identify the driver instance in use.
26179 */
26180 #define DRV_SPI_INDEX_0 0
26181 #define DRV_SPI_INDEX_1 1
26182 #define DRV_SPI_INDEX_2 2
26183 #define DRV_SPI_INDEX_3 3
26184 #define DRV_SPI_INDEX_4 4
26185 #define DRV_SPI_INDEX_5 5
26186 // *****************************************************************************
26187 /* SPI Driver Module Index Count
26188  Summary:
26189  Number of valid SPI driver indices.
26190  Description:
26191  This constant identifies the number of valid SPI driver indices.
26192  Remarks:
26193  This constant should be used in place of hard-coded numeric literals.
26194  This value is derived from device-specific header files defined as part
26195  of the peripheral libraries.
26196 */
26197 #define DRV_SPI_INDEX_COUNT SPI_NUMBER_OF_MODULES
26198 // *****************************************************************************
26199 /* SPI Clock Mode Selection
26200  Summary:
26201  Identifies the various clock modes of the SPI module.
26202  Description:
26203  This enumeration identifies the various clock modes of the SPI module.
26204  Remarks:
26205  None.
26206 */
26207 
26208 typedef
26209  enum
26210  {
26211  /* SPI Clock Mode 0:
26212  - Idle State of the clock is Low
26213  - Serial Output Data (SDO) Changed on Rising Edge of the clock
26214  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26216  /*DOM-IGNORE-BEGIN*/
26217  = 0 /*DOM-IGNORE-END*/
26218  ,
26219  /* SPI Clock Mode 1:
26220  - Idle State of the clock is Low
26221  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26222  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26224  /*DOM-IGNORE-BEGIN*/
26225  = 1 /*DOM-IGNORE-END*/
26226  ,
26227  /* SPI Clock Mode 2:
26228  - Idle State of the clock is High
26229  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26230  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26232  /*DOM-IGNORE-BEGIN*/
26233  = 2 /*DOM-IGNORE-END*/
26234  ,
26235  /* SPI Clock Mode 3:
26236  - Idle State of the clock is High
26237  - Serial Output Data (SDO) Changes on Rising Edge of the clock
26238  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26240  /*DOM-IGNORE-BEGIN*/
26241  = 3 /*DOM-IGNORE-END*/
26242  } DRV_SPI_CLOCK_MODE ;
26243 // *****************************************************************************
26244 /* SPI Buffer Type Selection
26245  Summary:
26246  Identifies the various buffer types of the SPI module.
26247  Description:
26248  This enumeration identifies the various buffer types of the SPI module.
26249  Remarks:
26250  None.
26251 */
26252 
26253 typedef
26254  enum
26255  {
26256  /* SPI Buffer Type Standard */
26258  /*DOM-IGNORE-BEGIN*/
26259  = 0 /*DOM-IGNORE-END*/
26260  ,
26261  /* SPI Enhanced Buffer Type */
26263  /*DOM-IGNORE-BEGIN*/
26264  = 1 /*DOM-IGNORE-END*/
26266 // *****************************************************************************
26267 /* SPI Protocols Enumeration
26268  Summary:
26269  Identifies the various protocols of the SPI module.
26270  Description:
26271  This enumeration identifies the various protocols of the SPI module.
26272  Remarks:
26273  None.
26274 */
26275 
26276 typedef
26277  enum
26278  {
26279  /* SPI Protocol Type Standard */
26281  /*DOM-IGNORE-BEGIN*/
26282  = 0 /*DOM-IGNORE-END*/
26283  ,
26284  /* SPI Protocol Type Framed */
26286  /*DOM-IGNORE-BEGIN*/
26287  = 1 /*DOM-IGNORE-END*/
26288  ,
26289  /*SPI Protocol Type Audio*/
26291  /*DOM-IGNORE-BEGIN*/
26292  = 2 /*DOM-IGNORE-END*/
26294 // *****************************************************************************
26295 /* SPI Driver Buffer Events
26296  Summary
26297  Identifies the possible events that can result from a buffer add request.
26298  Description
26299  This enumeration identifies the possible events that can result from a
26300  buffer add request caused by the client calling either
26301  DRV_SPI_BufferAddRead2 or DRV_SPI_BufferAddWrite2 or similar functions.
26302  Remarks:
26303  One of these values is passed in the "event" parameter of the event
26304  handling callback function that the client registered during buffer add
26305  requests.
26306 */
26307 
26308 typedef
26309  enum
26310  {
26311  /* Buffer is pending to get processed */
26313  /* Buffer is being processed */
26315  /* All data from or to the buffer was transferred successfully. */
26317  /* There was an error while processing the buffer transfer request. */
26320 // *****************************************************************************
26321 /* SPI Usage Modes Enumeration
26322  Summary:
26323  Identifies the various usage modes of the SPI module.
26324  Description:
26325  This enumeration identifies the various usage modes of the SPI module.
26326  Remarks:
26327  None.
26328 */
26329 
26330 typedef
26331  enum
26332  {
26333  /* SPI Mode Master */
26335  /*DOM-IGNORE-BEGIN*/
26336  = 0 /*DOM-IGNORE-END*/
26337  ,
26338  /* SPI Mode Slave */
26340  /*DOM-IGNORE-BEGIN*/
26341  = 1 /*DOM-IGNORE-END*/
26342  } DRV_SPI_MODE ;
26343 // *****************************************************************************
26344 /* SPI Task Modes Enumeration
26345  Summary:
26346  Identifies the various modes of how the tasks function will be run.
26347  Description:
26348  This enumeration identifies the various tasks mode
26349  Remarks:
26350  None.
26351 */
26352 
26353 typedef
26354  enum
26355  {
26356  /* Task is configured to run in polled mode */
26358  /*DOM-IGNORE-BEGIN*/
26359  = 0 /*DOM-IGNORE-END*/
26360  ,
26361  /* Task is configured to run in interrupt mode */
26363  /*DOM-IGNORE-BEGIN*/
26364  = 1 /*DOM-IGNORE-END*/
26365  } DRV_SPI_TASK_MODE ;
26366 // *****************************************************************************
26367 /* SPI Driver Buffer Event Handler Function Pointer
26368  Summary:
26369  Pointer to a SPI Driver Buffer Event handler function
26370  Description:
26371  This data type defines the required function signature for the SPI driver
26372  buffer event handling callback function. A client must register a pointer
26373  to a buffer event handling function who's function signature (parameter
26374  and return value types) match the types specified by this function pointer
26375  in order to receive buffer related event calls back from the driver.
26376  The parameters and return values and return value are described here and
26377  a partial example implementation is provided.
26378  Parameters:
26379  event - Identifies the type of event
26380  bufferHandle - Handle identifying the buffer to which the vent relates
26381  context - Value identifying the context of the application that
26382  registered the event handling function.
26383  Returns:
26384  None.
26385  Example:
26386  <code>
26387  void APP_MyBufferEventHandler( DRV_SPI_BUFFER_EVENT event,
26388  DRV_SPI_BUFFER_HANDLE bufferHandle,
26389  uintptr_t context )
26390  {
26391  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
26392  switch(event)
26393  {
26394  case DRV_SPI_BUFFER_EVENT_COMPLETE:
26395  // Handle the completed buffer.
26396  break;
26397  case DRV_SPI_BUFFER_EVENT_ERROR:
26398  default:
26399  // Handle error.
26400  break;
26401  }
26402  }
26403  </code>
26404  Remarks:
26405  If the event is DRV_SPI_BUFFER_EVENT_COMPLETE, it means that the data was
26406  transferred successfully.
26407  If the event is DRV_SPI_BUFFER_EVENT_ERROR, it means that the data was
26408  not transferred successfully.
26409  The bufferHandle parameter contains the buffer handle of the buffer that
26410  failed.
26411  The context parameter contains the a handle to the client context,
26412  provided at the time the event handling function registration.
26413  This context handle value is passed back to the client as the "context"
26414  parameter. It can be any value necessary to identify the client context
26415  or instance (such as a pointer to the client's data) instance of the
26416  client that made the buffer add request.
26417  The event handler function executes in an interrupt context when the driver
26418  is configured for interrupt mode operation. It is recommended of the
26419  application to not perform process intensive operations with in this
26420  function.
26421 */
26422 
26423 typedef
26425 DRV_SPI_BUFFER_HANDLE bufferHandle ,
26426 void * context ) ;
26427 // *****************************************************************************
26428 /* SPI Driver Initialization Data
26429  Summary:
26430  Defines the data required to initialize or reinitialize the SPI driver
26431  Description:
26432  This data type defines the data required to initialize or reinitialize the
26433  SPI driver. If the driver is built statically, the members of this data
26434  structure are statically over-ridden by static override definitions in the
26435  system_config.h file.
26436  Remarks:
26437  None.
26438 */
26439 
26440 typedef
26441 struct _DRV_SPI_INIT
26442 {
26443  /* System module initialization */
26444  SYS_MODULE_INIT moduleInit ;
26445  /* Identifies peripheral (PLIB-level) ID */
26446  SPI_MODULE_ID spiId ;
26447  /* SPI Task Mode Type*/
26449  /* SPI Usage Mode Type */
26451  /* Allow SPI to run when CPU goes to idle mode*/
26452  bool allowIdleRun ;
26453  /* SPI Protocol Type */
26455  /* SPI Slave Mode SSx Pin Select */
26456  bool spiSlaveSSPin ;
26457  /* Framed mode Sync Pulse*/
26458  SPI_FRAME_SYNC_PULSE frameSyncPulse ;
26459  /* Framed Mode pulse polarity*/
26460  SPI_FRAME_PULSE_POLARITY framePulsePolarity ;
26461  /* Framed Mode Pulse Direction*/
26462  SPI_FRAME_PULSE_DIRECTION framePulseDirection ;
26463  /* Framed mode Pulse Edge*/
26464  SPI_FRAME_PULSE_EDGE framePulseEdge ;
26465  /* Framed Mode Pulse width */
26466  SPI_FRAME_PULSE_WIDTH framePulseWidth ;
26467  /* Audio mode transmit mode*/
26468  SPI_AUDIO_TRANSMIT_MODE audioTransmitMode ;
26469  /* Audio mode protocol mode*/
26470  SPI_AUDIO_PROTOCOL audioProtocolMode ;
26471  /* Communication Width */
26472  SPI_COMMUNICATION_WIDTH commWidth ;
26473  /* SPI clock source which generates required baud rate.
26474  It can be either PBCLK or Reference Clock */
26475  SPI_BAUD_RATE_CLOCK baudClockSource ;
26476  /* when Baud rate clock source is peripheral clock, then this element is
26477  used to define which peripheral bus clock is used for this particular
26478  SPI instance. */
26479  CLK_BUSES_PERIPHERAL spiClk ;
26480  /* Baud Rate Value */
26481  uint32_t baudRate ;
26482  /* SPI Buffer Type */
26484  /* SPI Clock mode */
26486  /* SPI Input Sample Phase Selection */
26487  SPI_INPUT_SAMPLING_PHASE inputSamplePhase ;
26488  /* Transmit/Receive or Transmit Interrupt Source for SPI module */
26489  INT_SOURCE txInterruptSource ;
26490  /* Receive Interrupt Source for SPI module */
26491  INT_SOURCE rxInterruptSource ;
26492  /* Error Interrupt Source for SPI module */
26493  INT_SOURCE errInterruptSource ;
26494  /* While using standard buffer and polled mode how many transfers to do
26495  before yielding to other tasks*/
26496  uint8_t numTrfsSmPolled ;
26497  /* Dummy byte value which will be used for dummy transmission */
26498  uint32_t dummyByteValue ;
26499  /* This is the buffer queue size. This is the maximum
26500  number of transfer requests that driver will queue. */
26501  uint8_t queueSize ;
26502  /* This controls the minimum number of jobs that the driver will be able
26503  to accept without running out of memory. The driver will reserve this
26504  number of jobs from the global SPI queue so that it will always be available*/
26505  uint8_t jobQueueReserveSize ;
26506  /* This callback is fired when an operation is about to start on the
26507  SPI bus. This allows the user to set any pins that need to be set.
26508  This callback may be called from an ISR so should not include OSAL
26509  calls. The context parameter is the same one passed into the
26510  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26511  */
26513  /* This callback is fired when an operation has just completed on the
26514  SPI bus. This allows the user to set any pins that need to be set.
26515  This callback may be called from an ISR so should not include OSAL
26516  calls. The context parameter is the same one passed into the
26517  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26518  */
26520 } DRV_SPI_INIT ;
26521 // *****************************************************************************
26522 /* SPI Driver Client Specific Configuration
26523  Summary:
26524  Defines the data that can be changed per client.
26525  Description:
26526  This data type defines the data can be configured per client. This data can
26527  be per client, and overrides the configuration data contained inside of
26528  DRV_SPI_INIT.
26529  Remarks:
26530  None.
26531 */
26532 
26533 typedef
26534 struct _DRV_SPI_CLIENT_DATA
26535 {
26536  /* Baud Rate Value */
26537  uint32_t baudRate ;
26538  /* This callback is fired when an operation is about to start on the
26539  SPI bus. This allows the user to set any pins that need to be set.
26540  This callback may be called from an ISR so should not include OSAL
26541  calls. The context parameter is the same one passed into the
26542  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26543  */
26545  /* This callback is fired when an operation has just completed on the
26546  SPI bus. This allows the user to set any pins that need to be set.
26547  This callback may be called from an ISR so should not include OSAL
26548  calls. The context parameter is the same one passed into the
26549  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26550  */
26553 //DOM-IGNORE-BEGIN
26554 //DOM-IGNORE-END
26555  // #ifndef _DRV_SPI_DEFINITIONS_H
26556 /*******************************************************************************
26557  End of File
26558 */
26559 
26560 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h*/
26561 /* CLOSE_FILE Include File */
26562 
26563 // DOM-IGNORE-BEGIN
26564 // DOM-IGNORE-END
26565 // *****************************************************************************
26566 // *****************************************************************************
26567 // Section: Interface Routines - System Level
26568 // *****************************************************************************
26569 // *****************************************************************************
26570 // *****************************************************************************
26571 /* Function:
26572  SYS_MODULE_OBJ DRV_SPI_Initialize( const SYS_MODULE_INDEX index,
26573  const SYS_MODULE_INIT * const init )
26574  Summary:
26575  Initializes the SPI instance for the specified driver index.
26576  <p><b>Implementation:</b> Static/Dynamic</p>
26577  Description:
26578  This routine initializes the SPI driver instance for the specified driver
26579  index, making it ready for clients to open and use it. The initialization
26580  data is specified by the 'init' parameter. The initialization may fail if the
26581  number of driver objects allocated are insufficient or if the specified
26582  driver instance is already initialized. The driver instance index is
26583  independent of the SPI module ID. For example, driver instance 0 can be
26584  assigned to SPI2. If the driver is built statically, then some of the
26585  initialization parameters are overridden by configuration macros. Refer to
26586  the description of the DRV_SPI_INIT data structure for more details on
26587  which members on this data structure are overridden.
26588  Precondition:
26589  None.
26590  Parameters:
26591  index - Identifier for the instance to be initialized. Please note this
26592  is not the SPI id. The hardware SPI id is set in the initialization
26593  structure. This is the index of the driver index to use.
26594  init - Pointer to a data structure containing any data necessary to
26595  initialize the driver. If this pointer is NULL, the driver
26596  uses the static initialization override macros for each
26597  member of the initialization data structure.
26598  Returns:
26599  - If successful - returns a valid handle to a driver instance object
26600  - If unsuccessful - returns SYS_MODULE_OBJ_INVALID
26601  Example:
26602  <code>
26603  DRV_SPI_INIT init;
26604  SYS_MODULE_OBJ objectHandle;
26605  // Populate the SPI initialization structure
26606  init.spiId = SPI_ID_1,
26607  init.taskMode = DRV_SPI_TASK_MODE_ISR,
26608  init.spiMode = DRV_SPI_MODE_MASTER,
26609  init.allowIdleRun = false,
26610  init.spiProtocolType = DRV_SPI_PROTOCOL_TYPE_STANDARD,
26611  init.commWidth = SPI_COMMUNICATION_WIDTH_8BITS,
26612  init.baudClockSource = SPI_BAUD_RATE_PBCLK_CLOCK;
26613  init.spiClk = CLK_BUS_PERIPHERAL_2,
26614  init.baudRate = 10000000,
26615  init.bufferType = DRV_SPI_BUFFER_TYPE_ENHANCED,
26616  init.clockMode = DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL,
26617  init.inputSamplePhase = SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE,
26618  init.txInterruptSource = INT_SOURCE_SPI_1_TRANSMIT,
26619  init.rxInterruptSource = INT_SOURCE_SPI_1_RECEIVE,
26620  init.errInterruptSource = INT_SOURCE_SPI_1_ERROR,
26621  init.dummyByteValue = 0xFF,
26622  init.queueSize = 10,
26623  init.jobQueueReserveSize = 1,
26624  objectHandle = DRV_SPI_Initialize(DRV_SPI_INDEX_1, (SYS_MODULE_INIT*)usartInitData);
26625  if (SYS_MODULE_OBJ_INVALID == objectHandle)
26626  {
26627  // Handle error
26628  }
26629  </code>
26630  Remarks:
26631  This routine must be called before any other SPI routine is called.
26632  This routine should only be called once during system initialization
26633  unless DRV_SPI_Deinitialize is called to deinitialize the driver
26634  instance. This routine will NEVER block for hardware access.
26635 */
26636 
26637 SYS_MODULE_OBJ
26639  const SYS_MODULE_INDEX index ,
26640  const SYS_MODULE_INIT * const init ) ;
26641 //*************************************************************************
26642 /* Function:
26643  void DRV_SPI_Deinitialize ( SYS_MODULE_OBJ object )
26644  Summary:
26645  Deinitializes the specified instance of the SPI driver module.
26646  <p><b>Implementation:</b> Static/Dynamic</p>
26647  Description:
26648  Deinitializes the specified instance of the SPI driver module,
26649  disabling its operation (and any hardware) and invalidates all of the
26650  internal data.
26651  Precondition:
26652  Function DRV_SPI_Initialize must have been called before calling this
26653  routine and a valid SYS_MODULE_OBJ must have been returned.
26654  Parameters:
26655  object - Driver object handle, returned from DRV_SPI_Initialize
26656  Returns:
26657  None.
26658  Example:
26659  <code>
26660  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26661  SYS_STATUS status;
26662  DRV_SPI_Deinitialize ( object );
26663  status = DRV_SPI_Status( object );
26664  if( SYS_MODULE_UNINITIALIZED == status )
26665  {
26666  // Check again later if you need to know
26667  // when the driver is deinitialized.
26668  }
26669  </code>
26670  Remarks:
26671  Once the Initialize operation has been called, the De-initialize
26672  operation must be called before the Initialize operation can be called
26673  again.
26674  This function will NEVER block waiting for hardware. If the operation
26675  requires time to allow the hardware to complete, this will be reported
26676  by the DRV_SPI_Status operation. The system has to use DRV_SPI_Status
26677  to find out when the module is in the ready state.
26678 */
26679 
26680 void
26682  SYS_MODULE_OBJ object ) ;
26683 //**************************************************************************
26684 /* Function:
26685  SYS_STATUS DRV_SPI_Status ( SYS_MODULE_OBJ object )
26686  Summary:
26687  Provides the current status of the SPI driver module.
26688  <p><b>Implementation:</b> Static/Dynamic</p>
26689  Description:
26690  This function provides the current status of the SPI driver module.
26691  Precondition:
26692  The DRV_SPI_Initialize function must have been called before calling
26693  this function.
26694  Parameters:
26695  object - Driver object handle, returned from DRV_SPI_Initialize
26696  Returns:
26697  - SYS_STATUS_READY - Indicates that the driver is busy with a previous
26698  system level operation and cannot start another
26699  Example:
26700  <code>
26701  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26702  SYS_STATUS status;
26703  status = DRV_SPI_Status( object );
26704  if( SYS_STATUS_READY != status )
26705  {
26706  // Handle error
26707  }
26708  </code>
26709  Remarks:
26710  Any value greater than SYS_STATUS_READY is also a normal running state
26711  in which the driver is ready to accept new operations.
26712  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been
26713  deinitialized
26714  This value is less than SYS_STATUS_ERROR.
26715  This function can be used to determine when any of the driver's module
26716  level operations has completed.
26717  If the status operation returns SYS_STATUS_BUSY, the previous operation
26718  has not yet completed. Once the status operation returns
26719  SYS_STATUS_READY, any previous operations have completed.
26720  The value of SYS_STATUS_ERROR is negative (-1). Any value less than
26721  that is also an error state.
26722  This function will NEVER block waiting for hardware.
26723  If the Status operation returns an error value, the error may be
26724  cleared by calling the reinitialize operation. If that fails, the
26725  deinitialize operation will need to be called, followed by the
26726  initialize operation to return to normal operations.
26727 */
26728 
26729 SYS_STATUS
26730  DRV_SPI_Status (
26731  SYS_MODULE_OBJ object ) ;
26732 // *****************************************************************************
26733 /* Function:
26734  void DRV_SPI_Tasks ( SYS_MODULE_OBJ object );
26735  Summary:
26736  Maintains the driver's state machine and implements its ISR.
26737  <p><b>Implementation:</b> Static/Dynamic</p>
26738  Description:
26739  This routine is used to maintain the driver's internal state
26740  machine and implement its transmit ISR for interrupt-driven implementations.
26741  In polling mode, this function should be called from the SYS_Tasks()
26742  function. In interrupt mode, this function should be called in the transmit
26743  interrupt service routine of the USART that is associated with this USART
26744  driver hardware instance.
26745  Precondition:
26746  The DRV_SPI_Initialize routine must have been called for the specified
26747  SPI driver instance.
26748  Parameters:
26749  object - Object handle for the specified driver instance (returned from
26750  DRV_SPI_Initialize)
26751  Returns:
26752  None.
26753  Example:
26754  <code>
26755  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26756  while( true )
26757  {
26758  DRV_SPI_Tasks ( object );
26759  // Do other tasks
26760  }
26761  </code>
26762  Remarks:
26763  This function is normally not called directly by an application. It is
26764  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
26765  ISR.
26766  This function may execute in an ISR context and will never block or access any
26767  resources that may cause it to block.
26768 */
26769 
26770 void
26771  DRV_SPI_Tasks (
26772  SYS_MODULE_OBJ object ) ;
26773 // *****************************************************************************
26774 // *****************************************************************************
26775 // Section: Interface Routines - Client Level
26776 // *****************************************************************************
26777 // *****************************************************************************
26778 //**************************************************************************
26779 /* Function:
26780  DRV_HANDLE DRV_SPI_Open ( const SYS_MODULE_INDEX drvIndex,
26781  const DRV_IO_INTENT ioIntent )
26782  Summary:
26783  Opens the specified SPI driver instance and returns a handle to it.
26784  <p><b>Implementation:</b> Static/Dynamic</p>
26785  Description:
26786  This routine opens the specified SPI driver instance and provides a
26787  handle that must be provided to all other client-level operations to
26788  identify the caller and the instance of the driver. The ioIntent
26789  parameter defines how the client interacts with this driver instance.
26790  If ioIntent is DRV_IO_INTENT_READ, the client will only be read from
26791  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be
26792  able to write to the driver. If the ioIntent in
26793  DRV_IO_INTENT_READWRITE, the client will be able to do both, read and
26794  write.
26795  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
26796  exclusive access to this client. The driver cannot be opened by any
26797  other client.
26798  Precondition:
26799  The DRV_SPI_Initialize function must have been called before calling
26800  this function.
26801  Parameters:
26802  drvIndex - Index of the driver initialized with DRV_SPI_Initialize().
26803  Please note this is not the SPI ID.
26804  ioIntent - Zero or more of the values from the enumeration
26805  DRV_IO_INTENT ORed together to indicate the intended use of
26806  the driver
26807  Returns:
26808  If successful, the routine returns a valid open-instance handle (a
26809  number identifying both the caller and the module instance).
26810  If an error occurs, the return value is DRV_HANDLE_INVALID. An error
26811  can occur when the following is true:
26812  * if the number of client objects allocated via
26813  DRV_SPI_INSTANCES_NUMBER is insufficient
26814  * if the client is trying to open the driver but driver has been
26815  opened exclusively by another client
26816  * if the driver hardware instance being opened is not initialized or
26817  is invalid
26818  Example:
26819  <code>
26820  DRV_HANDLE handle;
26821  handle = DRV_SPI_Open( DRV_SPI_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
26822  if( DRV_HANDLE_INVALID == handle )
26823  {
26824  // Unable to open the driver
26825  }
26826  </code>
26827  Remarks:
26828  The handle returned is valid until the DRV_SPI_Close routine is
26829  called. This routine will NEVER block waiting for hardware. If the
26830  requested intent flags are not supported, the routine will return
26831  DRV_HANDLE_INVALID. This function is thread safe in a RTOS application.
26832  It should not be called in an ISR.
26833 */
26834 
26835 DRV_HANDLE
26836  DRV_SPI_Open (
26837  const SYS_MODULE_INDEX drvIndex ,
26838  const DRV_IO_INTENT ioIntent ) ;
26839 //**************************************************************************
26840 /* Function:
26841  int32_t DRV_SPI_ClientConfigure ( DRV_HANDLE handle,
26842  const DRV_SPI_CLIENT_DATA * cfgData )
26843  Summary:
26844  Configures a SPI client with specific data.
26845  <p><b>Implementation:</b> Static/Dynamic</p>
26846  Description:
26847  This routine takes a DRV_SPI_CLIENT_DATA structure and sets client specific options.
26848  Whenever a new SPI job is started these values will be used. Passing in NULL will
26849  reset the client back to configuration parameters passed to driver initialization.
26850  A zero in any of the structure elements will reset that specific configuration back
26851  to the driver default.
26852  Precondition:
26853  The DRV_SPI_Open function must have been called before calling
26854  this function.
26855  Parameters:
26856  handle - handle of the client returned by DRV_SPI_Open.
26857  cfgData - Client-specific configuration data.
26858  Returns:
26859  - If successful - the routing will return greater than or equal to zero
26860  - If an error occurs - the return value is negative
26861 */
26862 
26863 int32_t
26865  DRV_HANDLE handle ,
26866  const DRV_SPI_CLIENT_DATA * cfgData ) ;
26867 // *****************************************************************************
26868 /* Function:
26869  void DRV_SPI_Close ( DRV_HANDLE handle )
26870  Summary:
26871  Closes an opened instance of the SPI driver.
26872  <p><b>Implementation:</b> Static/Dynamic</p>
26873  Description:
26874  This function closes an opened instance of the SPI driver, invalidating the
26875  handle.
26876  Precondition:
26877  The DRV_SPI_Initialize routine must have been called for the specified
26878  SPI driver instance.
26879  DRV_SPI_Open must have been called to obtain a valid opened device handle.
26880  Parameters:
26881  handle - A valid open-instance handle, returned from the driver's
26882  open routine
26883  Returns:
26884  None.
26885  Example:
26886  <code>
26887  DRV_HANDLE handle; // Returned from DRV_SPI_Open
26888  DRV_SPI_Close ( handle );
26889  </code>
26890  Remarks:
26891  After calling this routine, the handle passed in "handle" must not be used
26892  with any of the remaining driver routines. A new handle must be obtained by
26893  calling DRV_SPI_Open before the caller may use the driver again. This
26894  function is thread safe in a RTOS application.
26895  Note:
26896  Usually there is no need for the driver client to verify that the Close
26897  operation has completed.
26898 */
26899 
26900 void
26901  DRV_SPI_Close (
26902  DRV_HANDLE handle ) ;
26903 // *****************************************************************************
26904 // *****************************************************************************
26905 // Section: Interface Routines - Client level Read & Write APIs
26906 // *****************************************************************************
26907 // *****************************************************************************
26908 /* These are non-blocking APIs. It doesn't wait until the operation gets
26909  finished. The actual operation will happen it the task routine. The status of
26910  this operation can be monitored using DRV_SPI_BufferStatus function. In
26911  polling mode, User must ensure that the code gets time to execute the task
26912  routine. */
26913 //*******************************************************************************
26914 /* Function:
26915  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead ( DRV_HANDLE handle, void *rxBuffer,
26916  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
26917  void * context )
26918  Summary:
26919  Registers a buffer for a read operation. Actual transfer will happen in
26920  the Task function.
26921  <p><b>Implementation:</b> Static/Dynamic</p>
26922  Description:
26923  Registers a buffer for a read operation. Actual transfer will happen in
26924  the Task function. The status of this operation can be monitored using
26925  DRV_SPI_BufferStatus function. A optional callback can also be
26926  provided that will be called when the operation is complete.
26927  Precondition:
26928  The DRV_SPI_Initialize routine must have been called for the specified
26929  SPI driver instance.
26930  DRV_SPI_Open must have been called to obtain a valid opened device
26931  handle.
26932  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
26933  in the DRV_SPI_Open call.
26934  Parameters:
26935  handle - A valid open-instance handle, returned from the driver's
26936  open routine
26937  rxBuffer - The buffer to which the data should be written to.
26938  size - Number of bytes to be read from the SPI bus.
26939  completeCB - Pointer to a function to be called when this queued operation is complete.
26940  context - unused by the driver but this is passed to the callback when it is called.
26941  Returns:
26942  If the buffer add request is successful, a valid buffer handle is returned.
26943  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
26944  Example:
26945  <code>
26946  DRV_HANDLE handle; // Returned from DRV_SPI_Open
26947  char myBuffer[MY_BUFFER_SIZE], state = 0;
26948  DRV_SPI_BUFFER_HANDLE bufferHandle;
26949  switch ( state )
26950  {
26951  case 0:
26952  bufferHandle = DRV_SPI_BufferAddRead( handle, myBuffer, 10, NULL, NULL );
26953  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
26954  {
26955  state++;
26956  }
26957  break;
26958  case 1:
26959  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
26960  {
26961  state++;
26962  // All transmitter data has been sent successfully.
26963  }
26964  break;
26965  }
26966  </code>
26967  Remarks:
26968  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddRead2"
26969  instead of it.
26970  */
26971 
26974  DRV_HANDLE handle ,
26975  void * rxBuffer ,
26976  size_t size ,
26977  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
26978  void * context ) ;
26979 //*******************************************************************************
26980 /* Function:
26981  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite ( DRV_HANDLE handle, void *txBuffer,
26982  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
26983  void * context )
26984  Summary:
26985  Registers a buffer for a write operation. Actual transfer will happen
26986  in the Task function.
26987  <p><b>Implementation:</b> Static/Dynamic</p>
26988  Description:
26989  Registers a buffer for a write operation. Actual transfer will happen
26990  in the Task function. The status of this operation can be monitored
26991  using DRV_SPI_BufferStatus function. A optional callback can also be
26992  provided that will be called when the operation is complete.
26993  Precondition:
26994  The DRV_SPI_Initialize routine must have been called for the specified
26995  SPI driver instance.
26996  DRV_SPI_Open must have been called to obtain a valid opened device
26997  handle.
26998  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
26999  in the DRV_SPI_Open call.
27000  Parameters:
27001  handle - A valid open-instance handle, returned from the driver's
27002  open routine
27003  txBuffer - The buffer which hold the data.
27004  size - Number of bytes to be written to the SPI bus.
27005  completeCB - Pointer to a function to be called when this queued operation is complete
27006  context - unused by the driver but this is passed to the callback when it is called
27007  Returns:
27008  If the buffer add request is successful, a valid buffer handle is returned.
27009  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27010  Example:
27011  <code>
27012  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27013  char myBuffer[MY_BUFFER_SIZE], state = 0;
27014  DRV_SPI_BUFFER_HANDLE bufferHandle;
27015  switch ( state )
27016  {
27017  case 0:
27018  bufferHandle = DRV_SPI_BufferAddWrite( handle, myBuffer, 10, NULL, NULL );
27019  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27020  {
27021  state++;
27022  }
27023  break;
27024  case 1:
27025  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27026  {
27027  state++;
27028  // All transmitter data has been sent successfully.
27029  }
27030  break;
27031  }
27032  </code>
27033  Remarks:
27034  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWrite2"
27035  instead of it.
27036 */
27037 
27040  DRV_HANDLE handle ,
27041  void * txBuffer ,
27042  size_t size ,
27043  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27044  void * context ) ;
27045 //*******************************************************************************
27046 /* Function:
27047  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead( DRV_HANDLE handle,
27048  void *txBuffer, void *rxBuffer, size_t size, )
27049  Summary:
27050  Registers a buffer for a read and write operation. Actual transfer will
27051  happen in the Task function.
27052  <p><b>Implementation:</b> Static/Dynamic</p>
27053  Description:
27054  Registers a buffer for a read and write operation. Actual transfer will
27055  happen in the Task function. The status of this operation can be
27056  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27057  provided that will be called when the operation is complete.
27058  Precondition:
27059  The DRV_SPI_Initialize routine must have been called for the specified
27060  SPI driver instance.
27061  DRV_SPI_Open must have been called to obtain a valid opened device
27062  handle.
27063  Parameters:
27064  handle - A valid open-instance handle, returned from the driver's
27065  open routine
27066  txBuffer - The buffer which hold the data.
27067  txSize - Number of bytes to be written to the SPI bus.
27068  rxBuffer - The buffer to which the data should be written to.
27069  rxSize - Number of bytes to be read from the SPI bus
27070  completeCB - Pointer to a function to be called when this queued operation is complete
27071  context - unused by the driver but this is passed to the callback when it is called
27072  Returns:
27073  If the buffer add request is successful, a valid buffer handle is returned.
27074  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27075  Example:
27076  <code>
27077  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27078  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27079  DRV_SPI_BUFFER_HANDLE bufferHandle;
27080  switch ( state )
27081  {
27082  case 0:
27083  bufferHandle = DRV_SPI_BufferAddWriteRead( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL );
27084  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27085  {
27086  state++;
27087  }
27088  break;
27089  case 1:
27090  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27091  {
27092  state++;
27093  // All transmitter data has been sent successfully.
27094  }
27095  break;
27096  }
27097  </code>
27098  Remarks:
27099  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWriteRead2"
27100  instead of it.
27101 */
27102 
27105  DRV_HANDLE handle ,
27106  void * txBuffer ,
27107  size_t txSize ,
27108  void * rxBuffer ,
27109  size_t rxSize ,
27110  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27111  void * context ) ;
27112 //*******************************************************************************
27113 /* Function:
27114  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2 ( DRV_HANDLE handle, void *rxBuffer,
27115  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27116  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27117  Summary:
27118  Registers a buffer for a read operation. Actual transfer will happen in
27119  the Task function.
27120  <p><b>Implementation:</b> Static/Dynamic</p>
27121  Description:
27122  Registers a buffer for a read operation. Actual transfer will happen in
27123  the Task function. The status of this operation can be monitored using
27124  DRV_SPI_BufferStatus function. A optional callback can also be
27125  provided that will be called when the operation is complete.
27126  Precondition:
27127  The DRV_SPI_Initialize routine must have been called for the specified
27128  SPI driver instance.
27129  DRV_SPI_Open must have been called to obtain a valid opened device
27130  handle.
27131  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
27132  in the DRV_SPI_Open call.
27133  Parameters:
27134  handle - A valid open-instance handle, returned from the driver's
27135  open routine
27136  rxBuffer - The buffer to which the data should be written to.
27137  size - Number of bytes to be read from the SPI bus.
27138  completeCB - Pointer to a function to be called when this queued operation is complete
27139  context - unused by the driver but this is passed to the callback when it is called
27140  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27141  Returns:
27142  If the buffer add request is successful, a valid buffer handle is returned.
27143  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27144  Example:
27145  <code>
27146  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27147  char myBuffer[MY_BUFFER_SIZE], state = 0;
27148  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27149  switch ( state )
27150  {
27151  case 0:
27152  bufferHandle = DRV_SPI_BufferAddRead2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27153  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27154  {
27155  state++;
27156  }
27157  break;
27158  case 1:
27159  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27160  {
27161  state++;
27162  // All transmitter data has been sent successfully.
27163  }
27164  break;
27165  }
27166  </code>
27167  Remarks:
27168  None.
27169  */
27170 
27173  DRV_HANDLE handle ,
27174  void * rxBuffer ,
27175  size_t size ,
27176  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27177  void * context ,
27178  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27179 //*******************************************************************************
27180 /* Function:
27181  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2 ( DRV_HANDLE handle, void *txBuffer,
27182  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27183  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27184  Summary:
27185  Registers a buffer for a write operation. Actual transfer will happen
27186  in the Task function.
27187  <p><b>Implementation:</b> Static/Dynamic</p>
27188  Description:
27189  Registers a buffer for a write operation. Actual transfer will happen
27190  in the Task function. The status of this operation can be monitored
27191  using DRV_SPI_BufferStatus function. A optional callback can also be
27192  provided that will be called when the operation is complete.
27193  Precondition:
27194  The DRV_SPI_Initialize routine must have been called for the specified
27195  SPI driver instance.
27196  DRV_SPI_Open must have been called to obtain a valid opened device
27197  handle.
27198  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27199  in the DRV_SPI_Open call.
27200  Parameters:
27201  handle - A valid open-instance handle, returned from the driver's
27202  open routine
27203  txBuffer - The buffer which hold the data.
27204  size - Number of bytes to be written to the SPI bus.
27205  completeCB - Pointer to a function to be called when this queued operation is complete
27206  context - unused by the driver but this is passed to the callback when it is called
27207  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27208  Returns:
27209  If the buffer add request is successful, a valid buffer handle is returned.
27210  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27211  Example:
27212  <code>
27213  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27214  char myBuffer[MY_BUFFER_SIZE], state = 0;
27215  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27216  switch ( state )
27217  {
27218  case 0:
27219  bufferHandle = DRV_SPI_BufferAddWrite2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27220  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27221  {
27222  state++;
27223  }
27224  break;
27225  case 1:
27226  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27227  {
27228  state++;
27229  // All transmitter data has been sent successfully.
27230  }
27231  break;
27232  }
27233  </code>
27234  Remarks:
27235  None.
27236 */
27237 
27240  DRV_HANDLE handle ,
27241  void * txBuffer ,
27242  size_t size ,
27243  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27244  void * context ,
27245  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27246 //*******************************************************************************
27247 /* Function:
27248  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2( DRV_HANDLE handle,
27249  void *txBuffer, void *rxBuffer, size_t size,
27250  DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27251  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27252  Summary:
27253  Registers a buffer for a read and write operation. Actual transfer will
27254  happen in the Task function.
27255  <p><b>Implementation:</b> Static/Dynamic</p>
27256  Description:
27257  Registers a buffer for a read and write operation. Actual transfer will
27258  happen in the Task function. The status of this operation can be
27259  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27260  provided that will be called when the operation is complete.
27261  Precondition:
27262  The DRV_SPI_Initialize routine must have been called for the specified
27263  SPI driver instance.
27264  DRV_SPI_Open must have been called to obtain a valid opened device
27265  handle.
27266  Parameters:
27267  handle - A valid open-instance handle, returned from the driver's
27268  open routine
27269  txBuffer - The buffer which hold the data.
27270  txSize - Number of bytes to be written to the SPI bus.
27271  rxBuffer - The buffer to which the data should be written to.
27272  rxSize - Number of bytes to be read from the SPI bus
27273  completeCB - Pointer to a function to be called when this queued operation is complete
27274  context - unused by the driver but this is passed to the callback when it is called
27275  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27276  Returns:
27277  If the buffer add request is successful, a valid buffer handle is returned.
27278  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27279  Example:
27280  <code>
27281  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27282  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27283  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27284  switch ( state )
27285  {
27286  case 0:
27287  bufferHandle = DRV_SPI_BufferAddWriteRead2( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL, &bufferHandle2 );
27288  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27289  {
27290  state++;
27291  }
27292  break;
27293  case 1:
27294  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27295  {
27296  state++;
27297  // All transmitter data has been sent successfully.
27298  }
27299  break;
27300  }
27301  </code>
27302  Remarks:
27303  None.
27304 */
27305 
27308  DRV_HANDLE handle ,
27309  void * txBuffer ,
27310  size_t txSize ,
27311  void * rxBuffer ,
27312  size_t rxSize ,
27313  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27314  void * context ,
27315  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27316 // *****************************************************************************
27317 /* Function:
27318  DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus ( DRV_SPI_BUFFER_HANDLE bufferHandle )
27319  Summary:
27320  Returns the transmitter and receiver transfer status.
27321  <p><b>Implementation:</b> Static/Dynamic</p>
27322  Description:
27323  This returns the transmitter and receiver transfer status.
27324  Precondition:
27325  The DRV_SPI_Initialize routine must have been called for the specified
27326  SPI driver instance.
27327  DRV_SPI_Open must have been called to obtain a valid opened device handle.
27328  DRV_SPI_BufferAdd<Transfer> must have been called to obtain
27329  the buffer handle associated with that transfer.
27330  Parameters:
27331  bufferHandle - A valid buffer handle, returned from the driver's
27332  data transfer routine
27333  Returns:
27334  A DRV_SPI_BUFFER_STATUS value describing the current status of the
27335  transfer.
27336  Example:
27337  <code>
27338  // Buffer handle returned from the data transfer function
27339  DRV_SPI_BUFFER_HANDLE bufferHandle;
27340  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27341  {
27342  // All transmitter data has been sent.
27343  }
27344  </code>
27345  Remarks:
27346  The returned status may contain a value with more than one of the bits
27347  specified in the DRV_SPI_BUFFER_STATUS enumeration set. The caller
27348  should perform an AND with the bit of interest and verify if the
27349  result is non-zero (as shown in the example) to verify the desired status
27350  bit.
27351 */
27352 
27355  DRV_SPI_BUFFER_HANDLE bufferHandle ) ;
27356 // *****************************************************************************
27357 /* Function:
27358  bool DRV_SPIn_ReceiverBufferIsFull(void)
27359  Summary:
27360  Returns the receive buffer status. 'n' represents the instance of the
27361  SPI driver used.
27362  <p><b>Implementation:</b> Static</p>
27363  Description:
27364  This function returns the receive buffer status (full/empty).
27365  Precondition:
27366  None.
27367  Parameters:
27368  None.
27369  Returns:
27370  Receive Buffer Status
27371  - 1 - Full
27372  - 0 - Empty
27373  Example:
27374  <code>
27375  bool rxBufStat;
27376  // Using instance 1 of SPI driver, that is n = 1
27377  rxBufStat = DRV_SPI1_ReceiverBufferIsFull();
27378  if (rxBufStat)
27379  {
27380  ...
27381  }
27382  </code>
27383  Remarks:
27384  None.
27385 */
27386 
27387 bool
27389 // *****************************************************************************
27390 /* Function:
27391  bool DRV_SPIn_TransmitterBufferIsFull(void)
27392  Summary:
27393  Returns the transmit buffer status. 'n' represents the instance of the
27394  SPI driver used.
27395  <p><b>Implementation:</b> Static</p>
27396  Description:
27397  This function returns the transmit buffer status (full/empty).
27398  Precondition:
27399  None.
27400  Parameters:
27401  None.
27402  Returns:
27403  Transmit Buffer Status
27404  - 1 - Full
27405  - 0 - Empty
27406  Example:
27407  <code>
27408  bool txBufStat;
27409  // Using instance 1 of SPI driver, that is n = 1
27410  txBufStat = DRV_SPI1_TransmitterBufferIsFull();
27411  if (txBufStat)
27412  {
27413  ...
27414  }
27415  </code>
27416  Remarks:
27417  None.
27418 */
27419 
27420 bool
27422 //DOM-IGNORE-BEGIN
27423 //DOM-IGNORE-END
27424  // #ifndef _DRV_SPI_H
27425 /*******************************************************************************
27426  End of File
27427 */
27428 
27429 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h*/
27430 /* CLOSE_FILE Include File */
27431 
27432 #include "driver/usb/usbhs/drv_usbhs.h"
27433 #include "usb/usb_device.h"
27434 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h */
27435 /**************************************************************************************/
27436 /* LDRA_INSPECTED 110 S
27437 */
27453 /**************************************************************************************/
27454 #ifndef APP_H /* Guard against multiple inclusion.*/
27455 #define APP_H
27456 /**************************************************************************************/
27457 /* ************************************************************************************/
27458 /* Section: Included Files */
27459 /**************************************************************************************/
27460 /**************************************************************************************/
27461 #include <stdint.h>
27462 /**************************************************************************************/
27463 /**************************************************************************************/
27464 /* Section: Data Types */
27465 /**************************************************************************************/
27466 /**************************************************************************************/
27467 /**************************************************************************************/
27468 /* APP_DATA
27469  Summary:
27470  Holds APP_DATA used for the APP tasks.
27471  Description:
27472  Holds APP_DATA used for the APP tasks. The variables
27473  used are stored here.
27474  Remarks:
27475  None
27476  */
27477 
27478 typedef
27479  struct
27480  {
27481  uint8_t RevNumber ;
27482  } APP_DATA ;
27483 
27484 extern APP_DATA
27485  APP ;
27486 /**************************************************************************************/
27487 /**************************************************************************************/
27488 /* Section: Application Initialization and State Machine Functions */
27489 /**************************************************************************************/
27490 /**************************************************************************************/
27491 /*!*************************************************************************************
27492  Function:
27493  void APP_Initialize(void)
27494  Summary:
27495  Autonomous tool application initialization routine.
27496  Description:
27497  This function initializes the application. It places the
27498  application in its initial state and prepares it to run so that its
27499  APP_Tasks function can be called.
27500  Precondition:
27501  All other system initialization routines should be called before calling
27502  this routine (in "SYS_Initialize").
27503  Parameters:
27504  None.
27505  Returns:
27506  None.
27507  Example:
27508  APP_Initialize()
27509  Remarks:
27510  This routine must be called from the main function.
27511 */
27512 
27513 void
27514  APP_Initialize ( void ) ;
27515 /*!*************************************************************************************
27516  Function:
27517  void APP_Tasks(void)
27518  Summary:
27519  Application tasks function
27520  Description:
27521  This function is the main application's tasks function. It contains the various
27522  tasks that are maintained during the operation of the shooting panel.
27523  Precondition:
27524  The system ("SYS_Initialize") and application ("APP_Initialize") initialization
27525  should be called before calling this.
27526  Parameters:
27527  None.
27528  Returns:
27529  None.
27530  Example:
27531  APP_Tasks()
27532  Remarks:
27533  This routine must be called from the main() routine.
27534  */
27535 
27536 void
27537  APP_Tasks ( void ) ;
27538  /* APP_H */
27539 /***************************************************************************************
27540  End of File
27541  */
27542 
27543 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h*/
27544 /* CLOSE_FILE Include File */
27545 
27546 // DOM-IGNORE-BEGIN
27547 // DOM-IGNORE-END
27548 // *****************************************************************************
27549 // *****************************************************************************
27550 // Section: Type Definitions
27551 // *****************************************************************************
27552 // *****************************************************************************
27553 // *****************************************************************************
27554 /* System Objects
27555  Summary:
27556  Structure holding the system's object handles
27557  Description:
27558  This structure contains the object handles for all objects in the
27559  MPLAB Harmony project's system configuration.
27560  Remarks:
27561  These handles are returned from the "Initialize" functions for each module
27562  and must be passed into the "Tasks" function for each module.
27563 */
27564 
27565 typedef
27566  struct
27567  {
27568  SYS_MODULE_OBJ sysTmr ;
27569  SYS_MODULE_OBJ drvTmr0 ;
27570  SYS_MODULE_OBJ drvTmr1 ;
27571  SYS_MODULE_OBJ drvTmr2 ;
27572  SYS_MODULE_OBJ drvTmr3 ;
27573  SYS_MODULE_OBJ drvTmr4 ;
27574  SYS_MODULE_OBJ drvUsart0 ;
27575  SYS_MODULE_OBJ drvPMP0 ;
27576  /*** SPI Object for Index 0 ***/
27577  SYS_MODULE_OBJ spiObjectIdx0 ;
27578  /*** SPI Object for Index 1 ***/
27579  SYS_MODULE_OBJ spiObjectIdx1 ;
27580  /*** SPI Object for Index 2 ***/
27581  SYS_MODULE_OBJ spiObjectIdx2 ;
27582  SYS_MODULE_OBJ drvUSBObject ;
27583  SYS_MODULE_OBJ usbDevObject0 ;
27584  } SYSTEM_OBJECTS ;
27585 // *****************************************************************************
27586 // *****************************************************************************
27587 // Section: extern declarations
27588 // *****************************************************************************
27589 // *****************************************************************************
27590 
27591 extern SYSTEM_OBJECTS
27592  sysObj ;
27593 //DOM-IGNORE-BEGIN
27594 //DOM-IGNORE-END
27595  /* _SYS_DEFINITIONS_H */
27596 /*******************************************************************************
27597  End of File
27598 */
27599 
27600 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h*/
27601 /* CLOSE_FILE Include File */
27602 
27603 /**************************************************************************************/
27604 /**************************************************************************************/
27605 /* Section: Data Types */
27606 /**************************************************************************************/
27607 /**************************************************************************************/
27608 /**************************************************************************************/
27609 /* UART states
27610  Summary:
27611  UART states enumeration
27612  Description:
27613  This enumeration defines the valid UART states. These states
27614  determine the behavior of the UART state machine at various times.
27615 */
27616 
27617 typedef
27618  enum
27619  {
27625  } UART_STATES ;
27626 /**************************************************************************************/
27627 /* UART Data
27628  Summary:
27629  Holds UART data used for the UART tasks.
27630  Description:
27631  Holds UART data used for the UART tasks. The state machine and variables used
27632  to control UART message are stored here.
27633  Remarks:
27634  None
27635  */
27636 
27637 typedef
27638  struct /* This structure collects the variables and states required for these*/
27639  {
27640  /* functions to operate.*/
27641  UART_STATES state ;
27642  DRV_HANDLE handleUSART0 ;
27643  bool write_complete ;
27644  bool usage ;
27647  uint8_t bytes_received ;
27648  } UART_DATA ;
27649 
27650 extern UART_DATA
27651  UART ;
27652 /**************************************************************************************/
27653 /**************************************************************************************/
27654 /* Section: Local Functions */
27655 /**************************************************************************************/
27656 /**************************************************************************************/
27657 /*!*************************************************************************************
27658  Function:
27659  static void ReadUART(void)
27660  Summary:
27661  This function reads a byte from the UART when data is received from the host.
27662  Description:
27663  This function reads a byte from the UART when data is received from the host. It
27664  puts the received byte into the RxFifo for later use.
27665 
27666  Precondition:
27667  None.
27668  Parameters:
27669  None.
27670  Returns
27671  None.
27672 
27673  Remarks
27674  None.
27675 
27676  Example:
27677  ReadUART()
27678  */
27679 
27680 static void
27681  ReadUART ( void ) ;
27682 /*!*************************************************************************************
27683  Function:
27684  static void WriteUART(void)
27685  Summary:
27686  This function transfers a byte to the host.
27687  Description:
27688  This function transfers a byte to the host. A byte is transferred from the
27689  TxFifo to the UART for transmission to the host. The baud rate is 115200,N-8-1.
27690  Once the required number of bytes are transferred, a flag is set to notify the
27691  UART_Tasks machine to look for a another transmission from the host.
27692 
27693  Precondition:
27694  None.
27695  Parameters:
27696  None.
27697  Returns
27698  None.
27699 
27700  Remarks
27701  None.
27702 
27703  Example:
27704  WriteUART()
27705  */
27706 
27707 static void
27708  WriteUART ( void ) ;
27709 /**************************************************************************************/
27710 /**************************************************************************************/
27711 /* State Machine Functions */
27712 /**************************************************************************************/
27713 /**************************************************************************************/
27714 /*!*************************************************************************************
27715  Function:
27716  *
27717  void UART_Tasks(void)
27718  Summary:
27719  UART_Tasks function
27720  Description:
27721  This routine is the UART_Tasks function. It defines the UART_Tasks state
27722  machine and core logic. This machine is used to send and receive data from the
27723  host.
27724  Precondition:
27725  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
27726  should be called before calling this.
27727  Parameters:
27728  None.
27729  Returns:
27730  None.
27731  Remarks:
27732  This routine must be called from the APP_Tasks() routine.
27733  Example:
27734  UART_Tasks()
27735  */
27736 
27737 void
27738  UART_Tasks ( void ) ;
27739  /* UART_H */
27740 /***************************************************************************************
27741  End of File
27742  */
27743 
27744 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\UART.h*/
27745 /* CLOSE_FILE Include File */
27746 
27747 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\fifo.h */
27748 /**************************************************************************************/
27762 /**************************************************************************************/
27763 #ifndef FIFO_H /* Guard against multiple inclusion */
27764 #define FIFO_H
27765 /**************************************************************************************/
27766 /**************************************************************************************/
27767 /* Section: Included Files */
27768 /**************************************************************************************/
27769 /**************************************************************************************/
27770 #include <stdbool.h>
27771 #include <stdint.h>
27772 /**************************************************************************************/
27773 /**************************************************************************************/
27774 /* Section: Defines */
27775 /**************************************************************************************/
27776 /**************************************************************************************/
27777 #define FIFO_RX_SIZE 7
27778 #define FIFO_TX_SIZE 7
27779  /* FifoPut Return values.*/
27780 #define FIFO_ADD_OK 0
27781 #define FIFO_FULL 1
27782  /* FifoGet Return Value.*/
27783 #define FIFO_EMPTY 2U
27784 /**************************************************************************************/
27785 /**************************************************************************************/
27786 /* Section: Data Types */
27787 /**************************************************************************************/
27788 /**************************************************************************************/
27789 
27790 typedef
27791  struct
27792  {
27793  uint8_t length ;
27794  uint8_t * ptr_buffer ;
27796  /* Filled in by the FIFO functions.*/
27797  uint8_t head ;
27798  uint8_t tail ;
27799  uint8_t num_records ;
27800  uint8_t put_error ;
27801  uint8_t get_error ;
27802  bool fEmpty ;
27803  bool fFull ;
27804  } TFifo ;
27805 
27806 extern TFifo
27807  RX_FIFO ; /* This structure is used for both the RxFifo and TxFifo.*/
27808 
27809 extern TFifo
27810  TX_FIFO ;
27811 /**************************************************************************************/
27812 /**************************************************************************************/
27813 /* Section: Local Functions */
27814 /**************************************************************************************/
27815 /**************************************************************************************/
27816 /*!*************************************************************************************
27817  Function:
27818  static void Fifo_Init( TFifo *ptrFifo, unsigned char *ptrBuffer, int Length )
27819  Summary:
27820  This function initializes a given Fifo.
27821  Description:
27822  This function initializes the communication Fifo. It is used to initialize both
27823  the transmit and receive Fifo's.
27824 
27825  Precondition:
27826  None.
27827  Parameters:
27828  None.
27829  Returns
27830  None.
27831 
27832  Remarks:
27833  None.
27834 
27835  Example:
27836  Fifo_Init( &RX_FIFO, FifoRxBuffer, FIFO_RX_SIZE )
27837  */
27838 
27839 static void
27840  Fifo_Init (
27841  TFifo * ptrFifo ,
27842  uint8_t * ptrBuffer ,
27843  uint16_t Length ) ;
27844 /**************************************************************************************/
27845 /**************************************************************************************/
27846 /* Section: Interface Functions */
27847 /**************************************************************************************/
27848 /**************************************************************************************/
27849 /*!*************************************************************************************
27850  Function:
27851  void Init_Fifo(void)
27852  Summary:
27853  This function calls the function Fifo_Init to initialize the RxFifo and TxFifo.
27854  Description:
27855  This function calls the function Fifo_Init to initialize the RxFifo and TxFifo.
27856  This function is called in APP_Initialize in app.c
27857 
27858 
27859  Precondition:
27860  None.
27861  Parameters:
27862  None.
27863  Returns
27864  None.
27865 
27866  Remarks:
27867  None.
27868 
27869  Example:
27870  Init_Fifo()
27871  */
27872 
27873 void
27874  Init_Fifo ( void ) ;
27875 /*!*************************************************************************************
27876  Function:
27877  uint8_t Fifo_Put( TFifo *ptrFifo, uint8_t Data )
27878  Summary:
27879  Function to add an entry (byte)to a Fifo.
27880  Description:
27881  Function to add an entry (byte)to a Fifo. If the Fifo is full then the function
27882  returns FIFO_FULL, otherwise the function adds the entry to the FifoBuffer,
27883  increments FifoHead and returns FIFO_ADD_OK.
27884 
27885  Precondition:
27886  None.
27887  Parameters:
27888  uint8_t Data: The byte of data to be added.
27889  TFifo *ptrFifo: The pointer to the Fifo that is being manipulated.
27890  Returns
27891  integer value. Fifo_Full or FIFO_ADD_OK
27892 
27893  Remarks:
27894  None.
27895 
27896  Example:
27897  Fifo_Put( &TX_FIFO, b_comm_crc )
27898  */
27899 
27900 uint8_t
27901  Fifo_Put (
27902  TFifo * ptrFifo ,
27903  uint8_t Data ) ;
27904 /*!*************************************************************************************
27905  Function:
27906  uint8_t Fifo_Get( TFifo *ptrFifo )
27907  Summary:
27908  Function to retrieve an entry from Fifo.
27909  Description:
27910  Function to retrieve an entry from Fifo. If Fifo is empty then function returns
27911  FIFO_EMPTY. Otherwise, the function returns the oldest entry in FifoBuffer and
27912  increments FifoTail.
27913 
27914  Precondition:
27915  None.
27916  Parameters:
27917  TFifo *ptrFifo
27918  Returns
27919  uint8_t Contents of Fifo buffer.
27920 
27921  Remarks:
27922  None.
27923 
27924  Example:
27925  temp = Fifo_Get( &RX_FIFO )
27926  */
27927 
27928 uint8_t
27929  Fifo_Get (
27930  TFifo * ptrFifo ) ;
27931 /*!*************************************************************************************
27932  Function:
27933  uint8_t Fifo_Length( TFifo *ptrFifo )
27934  Summary:
27935  Function to find the length of the buffer.
27936  Description:
27937  Function to find the length of the buffer.
27938 
27939  Precondition:
27940  None.
27941  Parameters:
27942  TFifo *ptrFifo: The pointer to the Fifo.
27943  Returns
27944  uint8_t. Length of the fifo buffer.
27945 
27946  Remarks:
27947  None.
27948 
27949  Example:
27950  if( Fifo_Length( &RX_FIFO ) == CMD.cmd_size )
27951  */
27952 
27953 uint8_t
27954  Fifo_Length (
27955  TFifo * ptrFifo ) ;
27956  /* FIFO_H */
27957 /***************************************************************************************
27958  End of File
27959  */
27960 
27961 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\fifo.h*/
27962 /* CLOSE_FILE Include File */
27963 
27964 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\commmodule.h */
27965 /**************************************************************************************/
27981 /**************************************************************************************/
27982 #ifndef COMMMODULE_H /* Guard against multiple inclusion.*/
27983 #define COMMMODULE_H
27984 /**************************************************************************************/
27985 /**************************************************************************************/
27986 /* Section: Included Files */
27987 /**************************************************************************************/
27988 /**************************************************************************************/
27989 #include "../system_definitions.h"
27990 /**************************************************************************************/
27991 /**************************************************************************************/
27992 /* Section: Data Types */
27993 /**************************************************************************************/
27994 /**************************************************************************************/
27995 /**************************************************************************************/
27996 /* COMM states
27997  Summary:
27998  COMM states enumeration
27999  Description:
28000  This enumeration defines the valid COMM states. These states
28001  determine the behavior of the COMM state machine at various times.
28002 */
28003 
28004 typedef
28005  enum
28006  {
28011  } COMM_STATES ;
28012 /**************************************************************************************/
28013 /* COMM Data
28014  Summary:
28015  Holds COMM data used for the COMM tasks.
28016  Description:
28017  Holds COMM data used for the COMM tasks. The state machine and variables used
28018  to control COMM message are stored here.
28019  Remarks:
28020  None
28021  */
28022 
28023 typedef
28024  struct /* This structure collects the variables and states required for these*/
28025  {
28026  /* functions to operate.*/
28027  COMM_STATES state ;
28028  DRV_HANDLE handleUSART0 ;
28029  uint8_t tx_count ;
28030  uint8_t rx_count ;
28031  bool processing ;
28032  } COMM_DATA ;
28033 
28034 extern COMM_DATA
28035  COMM ;
28036 /**************************************************************************************/
28037 /**************************************************************************************/
28038 /* Section: Local Functions */
28039 /**************************************************************************************/
28040 /**************************************************************************************/
28041 /*!*************************************************************************************
28042  Function:
28043  static void ValidateComm(void)
28044  Summary:
28045  This function reads the battery voltage, temperature and remaining capacity
28046  based on the command given to the function
28047  Description:
28048  Description: This task handles reading messages from Receive Queue (RxQ Fifo) and
28049  processes them. It looks for a valid command & upon finding it puts the remainder
28050  into the Command buffer for processing.
28051 
28052 
28053 
28054  Precondition:
28055  None.
28056  Parameters:
28057  None.
28058  Returns
28059  None.
28060 
28061  Remarks
28062  None.
28063 
28064  Example:
28065  void ValidateComm()
28066  */
28067 
28068 static void
28069  ValidateComm ( void ) ;
28070 /**************************************************************************************/
28071 /**************************************************************************************/
28072 /* State Machine Functions */
28073 /**************************************************************************************/
28074 /**************************************************************************************/
28075 /*!*************************************************************************************
28076  Function:
28077  void COMM_Tasks(void)
28078  Summary:
28079  COMM tasks function
28080  Description:
28081  This routine is the COMM tasks function. It defines the COMM's state machine and
28082  core logic. This task controls the communications between a host UART or host USB.
28083  Precondition:
28084  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28085  should be called before calling this.
28086  Parameters:
28087  None.
28088  Returns:
28089  None.
28090  Example:
28091  COMM_Tasks()
28092 
28093  Remarks:
28094  This routine must be called from COMM_Tasks() routine.
28095  */
28096 
28097 void
28098  COMM_Tasks ( void ) ;
28099  /* COMMMODULE_H */
28100 /***************************************************************************************
28101  End of File
28102  */
28103 
28104 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\commmodule.h*/
28105 /* CLOSE_FILE Include File */
28106 
28107 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\commands.h */
28108 /**************************************************************************************/
28122 /**************************************************************************************/
28123 #ifndef COMMANDS_H /* Guard against multiple inclusion.*/
28124 #define COMMANDS_H
28125 /**************************************************************************************/
28126 /**************************************************************************************/
28127 /* Section: Included Files */
28128 /**************************************************************************************/
28129 /**************************************************************************************/
28130 #include <stdbool.h>
28131 #include <stdint.h>
28132 /**************************************************************************************/
28133 /**************************************************************************************/
28134 /* Section: Global Variables */
28135 /**************************************************************************************/
28136 /**************************************************************************************/
28137 
28138 extern bool
28139  DepthStatus ;
28140 /**************************************************************************************/
28141 /**************************************************************************************/
28142 /* Section: Type Definition */
28143 /**************************************************************************************/
28144 /**************************************************************************************/
28145 
28146 typedef
28147 unsigned char
28149 /**************************************************************************************/
28150 /**************************************************************************************/
28151 /* Section: Data Types */
28152 /**************************************************************************************/
28153 /**************************************************************************************/
28154 /**************************************************************************************/
28155 
28156 typedef
28157  enum
28158  {
28163  } COMMAND_STATES ;
28164 
28165 typedef
28166  struct /* This structure collects the variables and states required for these*/
28167  {
28168  /* functions to operate.*/
28169  COMMAND_STATES state ;/* The COMMAND_TASKS machine current state.*/
28170  uint16_t crc ;
28171  uint8_t cmd_size ;
28172  uint8_t command [ 7 ] ;
28173  bool process_complete_flag ;
28174  bool b_command_complete_flag ;
28175  bool sw_status_bit_check ;
28176  } COMMAND_DATA ;
28177 
28178 extern COMMAND_DATA
28179  CMD ;
28180 /**************************************************************************************/
28181 /**************************************************************************************/
28182 /* Section: Interface Functions */
28183 /**************************************************************************************/
28184 /**************************************************************************************/
28185 /*!*************************************************************************************
28186  Function:
28187  void COMMAND_Tasks( void )
28188  Summary:
28189  This function executes the commands from the host.
28190  Description:
28191  This function executes the commands from the host. It does this by first ensuring
28192  the CRC of the received command is correct. If the CRC check matches, it goes on
28193  to execute the command. The commands are divided up into three types; Protocol A,
28194  Protocol B and System. Protocol A commands control the function of the Panel
28195  Interface Board. Protocol B commands are for a PerfSwitch or other down hole tool.
28196  System commands control the panel operation while it is being used for shooting.
28197  An example would be showing the depth status.
28198 
28199  Precondition:
28200  None.
28201  Parameters:
28202  None.
28203  Returns
28204  None.
28205 
28206  Remarks:
28207  None.
28208 
28209  Example:
28210  void COMMAND_Tasks()
28211  */
28212 
28213 void
28214  COMMAND_Tasks ( void ) ;
28215 /**************************************************************************************/
28216 /**************************************************************************************/
28217 /* Section: Local Functions */
28218 /**************************************************************************************/
28219 /**************************************************************************************/
28220 /*!*************************************************************************************
28221  Function:
28222  bool Valid_Command( uchar8_t msg )
28223  Summary:
28224  This function compares the received command(first byte)and compares it to a list
28225  of correct commands.
28226  Description:
28227  This function compares the received command(first byte)and compares it to a list
28228  of correct commands. If there is a match, the rest of the transmission is
28229  received for processing. Used in the ValidateComm function in commmodule.c
28230 
28231  Precondition:
28232  None.
28233  Parameters:
28234  uchar8_t msg - The one byte command to compare.
28235  Returns
28236  bool ans - true if command is valid.
28237 
28238  Remarks
28239  None.
28240 
28241  Example:
28242  Valid_Command( command )
28243  */
28244 
28245 bool
28246  Valid_Command (
28247  uchar8_t msg ) ;
28248 /*!*************************************************************************************
28249  Function:
28250  bool GetDepthStatus ( void )
28251  Summary:
28252  This function compares the received command(first byte)and compares it to a list
28253  of correct commands.
28254  Description:
28255  This function compares the received command(first byte)and compares it to a list
28256  of correct commands. If there is a match, the rest of the transmission is
28257  received for processing. Used in the ValidateComm function in commmodule.c
28258 
28259  Precondition:
28260  None.
28261  Parameters:
28262  unsigned char msg - The one byte command to compare.
28263  Returns
28264  unsigned short ans.
28265 
28266  Remarks
28267  None.
28268 
28269  Example:
28270  GetDepthStatus ( )
28271  */
28272 
28273 bool
28274  GetDepthStatus ( void ) ;
28275 /*!*************************************************************************************
28276  Function:
28277  static void Execute_Auto_Protocol_A (void)
28278  Summary:
28279  This function executes the Auto Protocol A commands.
28280  Description:
28281  This function executes the Auto Protocol A commands. These are commands that
28282  control the panel. The commands are listed as case statements. Once the action is
28283  completed, a response is generated and sent back to the host.
28284 
28285  Precondition:
28286  None.
28287  Parameters:
28288  None.
28289  Returns
28290  None.
28291 
28292  Remarks
28293  None.
28294 
28295  Example:
28296  Execute_Auto_Protocol_A ()
28297  */
28298 
28299 static void
28300  Execute_Auto_Protocol_A ( void ) ;
28301 /*!*************************************************************************************
28302  Function:
28303  static void Execute_Protocol_A (void)
28304  Summary:
28305  This function executes the Protocol A commands.
28306  Description:
28307  This function executes the Protocol A commands. These are commands that control
28308  the panel. The commands are listed as case statements. Once the action is
28309  completed, a response is generated and sent back to the host.
28310 
28311  Precondition:
28312  None.
28313  Parameters:
28314  None.
28315  Returns
28316  None.
28317 
28318  Remarks
28319  None.
28320 
28321  Example:
28322  ExecuteProtocolA ()
28323  */
28324 
28325 static void
28326  Execute_Protocol_A ( void ) ;
28327 /*!*************************************************************************************
28328  Function:
28329  static void Execute_Protocol_B (void)
28330  Summary:
28331  This function executes the Protocol B commands.
28332  Description:
28333  This function executes the Protocol B commands. These are commands that are for
28334  a PerfSwitch or other tool. The commands are listed as case statements. Once
28335  the action is completed, a response is generated and sent back to the host.
28336 
28337  Precondition:
28338  None.
28339  Parameters:
28340  None.
28341  Returns
28342  None.
28343 
28344  Remarks
28345  None.
28346 
28347  Example:
28348  ExecuteProtocolB ()
28349  */
28350 
28351 static void
28352  Execute_Protocol_B ( void ) ;
28353 /*!*************************************************************************************
28354  Function:
28355  static void Execute_System(void)
28356  Summary:
28357  This function executes the system commands.
28358  Description:
28359  This function executes the system commands. Once the action is completed, a
28360  response is generated and sent back to the host.
28361 
28362  Precondition:
28363  None.
28364  Parameters:
28365  None.
28366  Returns
28367  None.
28368 
28369  Remarks
28370  None.
28371 
28372  Example:
28373  ExecuteSystem()
28374  */
28375 
28376 static void
28377  Execute_System ( void ) ;
28378  /* COMMANDS_H */
28379 /***************************************************************************************
28380  End of File
28381  */
28382 
28383 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\commands.h*/
28384 /* CLOSE_FILE Include File */
28385 
28386 /**************************************************************************************/
28387 /* UART Data
28388  Summary:
28389  These structures hold the required states and variables to perform the UART tasks.
28390  Description:
28391  These structures hold the required states and variables to perform the UART tasks.
28392  These are here to link these structures for use by the local functions.
28393 
28394  Remarks:
28395  These are defined in UART.h
28396 */
28397 
28398 UART_DATA
28400 
28401 static UART_STATES
28403 /**************************************************************************************/
28404 /**************************************************************************************/
28405 /* Section: State Machine Functions */
28406 /**************************************************************************************/
28407 /**************************************************************************************/
28408 /***************************************************************************************
28409  Function:
28410  void UART_Tasks ( void )
28411  Summary:
28412  This routine is the UART_Tasks function. It defines the (UART) state machine and
28413  core logic.
28414  Remarks:
28415  Refer to the UART.h interface header for function usage details.
28416  */
28417 
28418 void
28419  UART_Tasks ( void )
28420  {
28421  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 28))); /* 37 */
28422  switch (
28423  ( ( int )( /* 29 */
28424  UART.state
28425  ))*
28426  ((bitmapstruct.element1 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 29) : 0)), 1 ) /* 19 */
28427  ) /* Check the machines current state.*/
28428  {
28429  case UART_STATE_INIT :
28430  ((bitmapstruct.element1 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 30) : 0)), 1 ); /* 41 */
28431  {
28432  UART.write_complete = false ; /* Set this flag to show we have not completed a write to the host.*/
28433  UART.usage = false ; /* Flag to show we are not communicating through the UART.*/
28434  UART.handleUSART0 = (
28435  (
28436  ( DRV_HANDLE ) - 1 ) ) ; /* Set the UART handle to invalid.*/
28437  UART.state = UART_STATE_OPEN ; /* Move on to open the UART port.*/
28438  UART.bytes_received = 0U ;
28439  }
28440  ((int)(bitmapstruct.element1 |= (1 << 31))); /* 16 */
28441  goto l128251 ;
28442  case UART_STATE_OPEN :
28443  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 0) : 0)), 1 ); /* 41 */
28444  {
28445  if
28446  (
28447  UART.handleUSART0 == (
28448  (
28449  ( DRV_HANDLE ) - 1 ) )
28450  ) /* Open the UART. This port is used for debugging only.*/
28451  {
28452  ((int)(bitmapstruct.element2 |= (1 << 1))); /* 1 */
28453  {
28454  /* LDRA_INSPECTED 123 S
28455 */
28456  /* LDRA_INSPECTED 120 S
28457 */ /* MPLAB Harmony created function.*/
28459  }
28460  } else ((int)(bitmapstruct.element2 |= (1 << 2))); /* 4 */
28461  if
28462  (
28463  UART.handleUSART0 != (
28464  (
28465  ( DRV_HANDLE ) - 1 ) )
28466  ) /* Once the UART port is open,*/
28467  {
28468  ((int)(bitmapstruct.element2 |= (1 << 3))); /* 1 */
28469  {
28470  UART.state = UART_STATE_READ ; /* move on to check for data received via the UART port.*/
28471  }
28472  } else ((int)(bitmapstruct.element2 |= (1 << 4))); /* 4 */
28473  }
28474  ((int)(bitmapstruct.element2 |= (1 << 5))); /* 16 */
28475  goto l128251 ;
28476  case UART_STATE_READ :
28477  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 6) : 0)), 1 ); /* 41 */
28478  /* Stay here until data is received.*/
28479  {
28480 /* ReadUART()*/ /* Check for and read a byte from the host.*/
28481  if
28482  (
28484  ) /* If we have received enough bytes for a command,*/
28485  {
28486  ((int)(bitmapstruct.element2 |= (1 << 7))); /* 1 */
28487  {
28488  UART.bytes_received = 0U ; /* Reset the counter.*/
28489  UART.state = UART_STATE_WAIT ; /* move on to wait for the command to be processed.*/
28490  COMM.state = COMM_STATE_VALIDATE ; /* Check to see if we have received a valid command.*/
28491  }
28492  } else ((int)(bitmapstruct.element2 |= (1 << 8))); /* 4 */
28493  }
28494  ((int)(bitmapstruct.element2 |= (1 << 9))); /* 16 */
28495  goto l128251 ;
28496  case UART_STATE_WAIT :
28497  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 10) : 0)), 1 ); /* 41 */
28498  /* Wait here to process a command before sending response.*/
28499  { /* State will move to WRITE from commmodule.c.*/
28500  }
28501  ((int)(bitmapstruct.element2 |= (1 << 11))); /* 16 */
28502  goto l128251 ;
28503  case UART_STATE_WRITE :
28504  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 12) : 0)), 1 ); /* 41 */
28505  /* Send the command response to the host.*/
28506  {
28507  ((int)(bitmapstruct.element2 |= (1 << 13))); /* 23 */
28508 
28509  WriteUART () ; /* Send the command response.*/
28510  if
28511  (
28512  UART.write_complete == true
28513  ) /* If we have completed sending the response,*/
28514  {
28515  ((int)(bitmapstruct.element2 |= (1 << 14))); /* 1 */
28516  {
28517  UART.write_complete = false ; /* reset the flag.*/
28518  UART.state = UART_STATE_READ ; /* Move to look for the next data from the host.*/
28519  UART.usage = false ; /* Flag to show we are not communicating through the UART.*/
28520  }
28521  } else ((int)(bitmapstruct.element2 |= (1 << 15))); /* 4 */
28522  }
28523  ((int)(bitmapstruct.element2 |= (1 << 16))); /* 16 */
28524  goto l128251 ;
28525  default :
28526  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 17) : 0)), 1 ); /* 41 */
28527  {
28528  /* Comment.*/
28529  }
28530  ((int)(bitmapstruct.element2 |= (1 << 18))); /* 16 */
28531  goto l128251 ;
28532  }
28533 l128251 :
28534  ; /* 18 */
28535  ((int)(bitmapstruct.element2 |= (1 << 19))); /* 30 */
28536  UART_71zqendz ( 84 ) ; /* 30 */
28537  }
28538 /**************************************************************************************/
28539 /**************************************************************************************/
28540 /* Section: Local Functions */
28541 /**************************************************************************************/
28542 /**************************************************************************************/
28543 /*!*************************************************************************************
28544  Function:
28545  static void ReadUART(void)
28546  Summary:
28547  This function reads a byte of data from the UART and transfers it to the RxFifo.
28548  Remarks:
28549  Refer to the UART.h interface header for function usage details.
28550  */
28551 
28552 static void
28553  ReadUART ( void )
28554  {
28555  int izzqqzz=((int)(bitmapstruct.element2 |= (1 << 20))); /* 37 */
28556  static uint8_t
28557  uart_bytes = 0U ;
28559  /* LDRA_INSPECTED 433 S
28560 */ /* MPLAB Harmony function returns a boolean result.*/
28561  if
28562  (
28564  ) /* If the UART receive buffer has data in it,*/
28565  {
28566  ((int)(bitmapstruct.element2 |= (1 << 21))); /* 1 */
28567  {
28568  /* LDRA_INSPECTED 434 S
28569 */ /*MPLAB Harmony function.*/
28570  uart_bytes = DRV_USART_ReadByte ( COMM.handleUSART0 ) ;/* Read a received byte and */
28571  ( void ) Fifo_Put ( & RX_FIFO , uart_bytes ) ;/* put the byte into the RxFifo.*/
28572  UART.usage = true ;/* Shows that we received data via the UART and not the USB.*/
28573  UART.bytes_received ++ ;/* Increment counter for number of bytes received via the UART.*/
28574  }
28575  ((int)(bitmapstruct.element2 |= (1 << 22))); /* 3 */
28576  }
28577  else
28578  {
28579  ((int)(bitmapstruct.element2 |= (1 << 23))); /* 2 */
28580  {
28581  /*Comment.*/
28582  }
28583  }
28584  ((int)(bitmapstruct.element2 |= (1 << 24))); /* 30 */
28585  UART_71zqendz ( 89 ) ; /* 30 */
28586  }
28587 /***************************************************************************************
28588  Function:
28589  static void WriteUART(void)
28590  Summary:
28591  This function gets a byte of data from the TxFifo and writes it to the UART.
28592  Remarks:
28593  Refer to the UART.h interface header for function usage details.
28594  */
28595 
28596 static void
28597  WriteUART ( void )
28598  {
28599  int izzqqzz=((int)(bitmapstruct.element2 |= (1 << 25))); /* 37 */
28600  if
28601  (
28603  ) /* If we have not transmitted enough bytes*/
28604  {
28605  ((int)(bitmapstruct.element2 |= (1 << 26))); /* 1 */
28606  {
28607  if
28608  (
28609  PLIB_USART_TransmitterIsEmpty ( USART_ID_1 ) == 1
28610  ) /* and if the transmitter buffer is empty,*/
28611  {
28612  ((int)(bitmapstruct.element2 |= (1 << 27))); /* 1 */
28613  {
28614  /* LDRA_INSPECTED 434 S
28615 */ /*MPLAB Harmony function.*/
28616  PLIB_USART_TransmitterByteSend ( USART_ID_1 ,
28617  Fifo_Get ( & TX_FIFO ) ) ; /* Send character.*/
28618  COMM.tx_count ++ ;/* Increment counter.*/
28619  }
28620  } else ((int)(bitmapstruct.element2 |= (1 << 28))); /* 4 */
28621  }
28622  ((int)(bitmapstruct.element2 |= (1 << 29))); /* 3 */
28623  }
28624  else
28625  {
28626  ((int)(bitmapstruct.element2 |= (1 << 30))); /* 2 */
28627  {
28628  if
28629  (
28631  ) /* If we have tranmitted enough bytes,*/
28632  {
28633  ((int)(bitmapstruct.element2 |= (1 << 31))); /* 1 */
28634  {
28635  COMM.tx_count = 0U ;/* reset the counter.*/
28636  UART.write_complete = true ;/* Set flag to show we have completed writing the response.*/
28637  }
28638  ((int)(bitmapstruct.element3 |= (1 << 0))); /* 3 */
28639  }
28640  else
28641  {
28642  ((int)(bitmapstruct.element3 |= (1 << 1))); /* 2 */
28643  {
28644  /*Comment.*/
28645  }
28646  }
28647  }
28648  }
28649  ((int)(bitmapstruct.element3 |= (1 << 2))); /* 30 */
28650  UART_71zqendz ( 99 ) ; /* 30 */
28651  }
28652 /***************************************************************************************
28653  End of File
28654  */
28655 #define qqqbranches 99
28656 #define QQQMAXMCDCSIZE 2
28657 /********************** LDRA_PORT INSTRUMENTATION **********************/
28658 
28659 /******************* END OF LDRA_PORT INSTRUMENTATION ******************/
28660 #define ldra_sscanf
28661  /* put in undefs to protect our parameter names from macros */
28662 #undef f
28663 #undef i
28664 #undef j
28665 #undef k
28666 #undef s
28667 #undef l
28668 #undef ii
28669 #undef some
28670 #undef none
28671 #undef from
28672 #undef a
28673 #undef b
28674 #undef iz
28675 #undef jz
28676 #undef qqnull_params
28677 #define qqnull_params void
28678  /* Conventional Instrumentation */
28679 #define qqzzidfield 1
28680  /* single file or fileid */
28681  /* these have an extra field for the fileid */
28682  static char qqqqone[] = "%6d\n"; /* single point */
28683  /* uncompressed data structures */
28684  /* uncompressed bitmap */
28685 #define QQQFIXEDSIZE
28686  static int qqqlast = 0;
28687  extern int qqupload_registered;
28688  extern int UART_71zqqzqz(qqnull_params);
28689  extern int UART_71zqqzqz1(qqnull_params);
28690  /* ----------------------------------------------------------------------* 200 *
28691  * Procedures
28692  * -----------------------------------------------------------------------------
28693  */
28694  /* ----------- zscanf ---------------------------------------------------* 201 *
28695  * Returns an integer extracted from a string
28696  * -----------------------------------------------------------------------------
28697  */
28698  static int UART_71zscanf(char * qqscan_str)
28699  {
28700  int qqvalue;
28701  int qqisign;
28702  char * qqcptr;
28703  qqvalue = 0;
28704  qqisign = 1;
28705  qqcptr = qqscan_str;
28706  /* Skip spaces */
28707  while (qqcptr[0] == ' ')
28708  {
28709  qqcptr++;
28710  }
28711  /* Check for a leading ---
28712  */
28713  if (qqcptr[0] == '-')
28714  {
28715  qqisign = -1;
28716  qqcptr++;
28717  }
28718  /* Extract digits */
28719  while ((qqcptr[0] >= '0') && (qqcptr[0] <= '9'))
28720  {
28721  qqvalue = 10 * qqvalue;
28722  qqvalue = qqvalue + (qqcptr[0] - '0');
28723  qqcptr++;
28724  }
28725  qqvalue = qqisign * qqvalue;
28726  return qqvalue;
28727  } /* end of zscanf */
28728  /* ----------------------------------------------------------------------* 210 *
28729  * C System utilities in use:
28730  * fprintf
28731  * fclose
28732  * sscanf
28733  * -----------------------------------------------------------------------------
28734  */
28735  /* ----------------------------------------------------------------------* 213 *
28736  * qqoutput* suite
28737  * Main output routines. These may require modification.
28738  * -----------------------------------------------------------------------------
28739  */
28740  /* ----------------------------------------------------------------------* 214 *
28741  * qqoutput
28742  * This is the principle output routine.
28743  * -----------------------------------------------------------------------------
28744  */
28745  static void qqoutput(FILEPOINT char * s,int i)
28746  /* f - file pointer, s - format string, i - integer for probe value */
28747  {
28748  /* printing to a file */
28749  /* fprintf exists, not threaded */
28750  /* fprintf exists, not threaded, ( SINGLEFILE or FILEID ) */
28751  ldra_sprintf2 (&ldra_buffer[0], s,i,zzfileid);
28752  ldra_port_write (&ldra_buffer[0]);
28753  } /* end of qqoutput */
28754  /* ----------------------------------------------------------------------* 215 *
28755  * qqoutput0
28756  * -----------------------------------------------------------------------------
28757  */
28758  static void qqoutput0(FILEPOINT char * s)
28759  {
28760  ldra_port_write(s);
28761  } /* end of qqoutput0 */
28762  /* ----------------------------------------------------------------------* 216 *
28763  * qqoutput2
28764  * -----------------------------------------------------------------------------
28765  */
28766  static void qqoutput2(FILEPOINT char * s,int i, int j)
28767  {
28768  ldra_sprintf2 (&ldra_buffer[0], s, i, j);
28769  ldra_port_write (&ldra_buffer[0]);
28770  } /* end of qqoutput2 */
28771  /* ----------------------------------------------------------------------* 217 *
28772  * qqoutput3
28773  * -----------------------------------------------------------------------------
28774  */
28775  static void qqoutput3(FILEPOINT char * s,int i,int j,int k)
28776  {
28777  ldra_sprintf3 (&ldra_buffer[0], s, i, j, k);
28778  ldra_port_write (&ldra_buffer[0]);
28779  } /* end of qqoutput3 */
28780  /* ----------------------------------------------------------------------* 218 *
28781  * qqoutput4
28782  * -----------------------------------------------------------------------------
28783  */
28784  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l)
28785  {
28786  ldra_sprintf4 (&ldra_buffer[0], s, i, j, k, l);
28787  ldra_port_write (&ldra_buffer[0]);
28788  } /* end of qqoutput4 */
28789  /* ----------------------------------------------------------------------* 219 *
28790  * end of qqoutput* suite
28791  * -----------------------------------------------------------------------------
28792  */
28793  /* ----------------------------------------------------------------------* 222 *
28794  * qqqqinitialise
28795  * This procedure initialises the structures for
28796  * compressed execution histories.
28797  * -----------------------------------------------------------------------------
28798  */
28799  static void qqqqinitialise(int ii)
28800  {
28801  unsigned int i;
28802  /* First time through. */
28803  /* bitmap */
28804  /* bitmap separate */
28805  qqqlast = 1; /* stops qqfun() calling initialise again */
28806  /* bitmap */
28807  /* bitmap singlefile */
28808  /* struct singlefile notmainfl */
28809  } /* end of qqqqinitialise */
28810 /* ----------------------------------------------------------------------* 225 *
28811 * qqqbitmapreset
28812 * This procedure resets the structures for
28813 * compressed execution histories.
28814 * -----------------------------------------------------------------------------
28815 */
28816 static void qqqbitmapreset()
28817 {
28818 struct bitmapstruct_t localbitmap = {0};
28819 bitmapstruct = localbitmap;
28820 } /* end of qqqbitmapreset */
28821 #undef QQQTEMP1
28822 #define QQQTEMP1
28823  /* ----------- zqqzqz ---------------------------------------------------* 310 *
28824  * -----------------------------------------------------------------------------
28825  */
28826  /* ----------------------------------------------------------------------* 312 *
28827  * This routine opens the execution history file. It is instrumented at the
28828  * start of the main program if one exists in the file. In general this is
28829  * superceded by UART_71zqqzqz1 below.
28830  * -----------------------------------------------------------------------------
28831  */
28833  {
28834  if ( UART_71zzopen != 1 )
28835  {
28836 #undef QQQMUSTOPEN
28837  UART_71zzopen = 1;
28838  }
28839  return(1);
28840  } /* end of zqqzqz */
28841  /* ----------- zqqzqz1 --------------------------------------------------* 315 *
28842  * -----------------------------------------------------------------------------
28843  */
28844  /* ----------------------------------------------------------------------* 317 *
28845  * This routine also opens the execution history file. It is called
28846  * automatically if a probe fires and the execution history is not already
28847  * opened (UART_71zzopen = 0 ).
28848  * Because this always works ( it was intended for files with no main program
28849  * it is now the de facto common way to open the execution history.
28850  * -----------------------------------------------------------------------------
28851  */
28853  {
28854  if ( UART_71zzopen != 1 )
28855  {
28856  ldra_port_open(); /* 7 */
28857  qqqqinitialise(0);
28858  UART_71zzopen = 1;
28859  }
28860  return(1);
28861  } /* end of zqqzqz1 */
28862  /* ----------- zqendz ---------------------------------------------------* 330 *
28863  * This routine is called on exiting a routine in a
28864  * module. It closes the execution history.
28865  * -----------------------------------------------------------------------------
28866  */
28867 static int UART_71zqendz(int qqqi)
28868  {
28869  if (!qqqstructzzopen)
28870  {
28872  qqqstructzzopen = 1;
28873  }
28874  if ( UART_71zzopen != 1 )
28875  {
28876  UART_71zqqzqz1();
28877  }
28878  /* ----------------------------------------------------------------------* 331 *
28879  * this is the one which puts an integer into
28880  * the execution history file and returns unity.
28881  * The format of each field consists of six columns,
28882  * the number is right justified in this field.
28883  * -----------------------------------------------------------------------------
28884  */
28885  if ( UART_71zzopen )
28886  {
28887  /* uncompressed */
28888  /* uncompressed unbuffered */
28889  /* uncompressed unbuffered bitmap */
28890  if ( qqqi > 0 )
28891  {
28892  }
28893  else
28894  {
28895  }
28896  }
28897  qqqlast = 0;
28898  return(1);
28899  } /* end of zqendz */
28900  /* ----------------------------------------------------------------------* 335 *
28901  * Output structure - qqbmsoutput
28902  * -----------------------------------------------------------------------------
28903  */
28904  static void qqbmsoutput(FILEPOINT char * s, unsigned int i)
28905  {
28906  static int branches_printed = 0;
28907  int b, last = 0;
28908  for(b=0;b<qqqqbmselwidth/8;b++)
28909  {
28910  ldra_sprintf1 (&ldra_buffer[0], s, (i >> last) & ~(~0 << 8));
28911  ldra_port_write (&ldra_buffer[0]);
28912  ldra_sprintf1 (&ldra_buffer[0], "%8d\n", zzfileid );
28913  ldra_port_write (&ldra_buffer[0]);
28914  last += 8;
28915  branches_printed += 8;
28916  if (branches_printed >= qqqbranches)
28917  {
28918  /* do not print any more, can be left over when using more than 8 bits to store bitmap */
28919  break;
28920  }
28921  }
28922  }
28923  /* ----------------------------------------------------------------------* 336 *
28924  * qqqupload
28925  * This routine loops through the stored bitmap and
28926  * outputs it. It then uploads the stored mcdc.
28927  * -----------------------------------------------------------------------------
28928  */
28929  static void qqqupload(qqnull_params)
28930  {
28931  int i;
28932  /* uncompressed bitmap (!singlefile or mainfl) separate */
28933  {
28934  UART_71zqqzqz1();
28935 #define ELEMENT(N) qqbmsoutput("%8d", bitmapstruct.element##N);
28936 #define LASTELEMENT
28937 #include "UART_71zbelem.def"
28938 #undef LASTELEMENT
28939 #undef ELEMENT
28940  }
28941  /* bitmap separate */
28942  qqqlast = 1; /* stops qqfun() calling initialise again */
28943  } /* end of qqqupload */
28944  /* ----------- zqzqzq ---------------------------------------------------* 342 *
28945  * -----------------------------------------------------------------------------
28946  */
28947  /* ----------------------------------------------------------------------* 344 *
28948  * This routine should be called before the program
28949  * terminates. It closes the execution history
28950  * -----------------------------------------------------------------------------
28951  */
28952  static int UART_71zqzqzq(int qqqi)
28953  {
28954  if ( UART_71zzopen != 1 )
28955  {
28956  UART_71zqqzqz1();
28957  }
28958  /* not compressed */
28959  /* do nothing for bitmap*/
28960  /* upload the history */
28961  /* bitmap */
28962  /* uncompressed bitmap */
28963  UART_71zqendz(qqqi);
28964  /* qqqupload closes the execution history file */
28965  return(1);
28966  } /* end of zqzqzq */
28967  /* the following routines should be left alone */
28968 /* END OF TESTBED INSTRUMENTATION */
28969 
static void DRV_TMR2_DeInitialize(void)
Definition: inszt_UART.c:3833
bool PLIB_SPI_ExistsBusStatus(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXAutoEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXINTSourceFlagClear(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void PLIB_PORTS_PinChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_USART_ExistsReceiverOverrunStatus(USART_MODULE_ID index)
void PLIB_USART_ReceiverAddressAutoDetectDisable(USART_MODULE_ID index)
UART_STATES
Definition: inszt_UART.c:27617
void PLIB_USART_ReceiverInterruptModeSelect(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE interruptMode)
void DRV_TMR1_StopInIdleEnable(void)
void DRV_TMR_Stop(DRV_HANDLE handle)
SPI_BAUD_RATE_CLOCK baudClockSource
Definition: inszt_adc.c:26566
void SYS_DMA_ChannelCRCSet(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc)
uint8_t PLIB_USART_AddressMaskGet(USART_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXPatternLength(DMA_MODULE_ID index)
SYS_DMA_CHANNEL_CHAIN_PRIO
Definition: inszt_UART.c:13204
uint16_t PLIB_DMA_ChannelXPeripheralAddressGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION function, PORTS_REMAP_INPUT_PIN remapPin)
DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void SYS_PORTS_ChangeNotificationGlobalEnable(PORTS_MODULE_ID index)
void DRV_TMR1_Stop(void)
bool PLIB_DMA_ChannelXChainIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool DRV_USART_ReceiverBufferIsEmpty(const DRV_HANDLE handle)
void PLIB_SPI_FrameSyncPulsePolaritySelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_POLARITY polarity)
static void DRV_TMR3_Tasks(void)
Definition: inszt_UART.c:4024
void PLIB_DMA_ChannelXDestinationStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t destinationStartAddress)
bool SYS_PORTS_PinLatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void Fifo_Init(TFifo *ptrFifo, uint8_t *ptrBuffer, uint16_t Length)
void PLIB_USART_TransmitterIdleIsLowDisable(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsRemapOutput(PORTS_MODULE_ID index)
void PLIB_PORTS_AnPinsModeSelect(PORTS_MODULE_ID index, PORTS_AN_PIN anPins, PORTS_PIN_MODE mode)
bool DRV_TMR_Start(DRV_HANDLE handle)
COMMAND_STATES
Definition: commands.h:62
void SYS_DMA_ChannelAbortEventSet(SYS_DMA_CHANNEL_HANDLE handle, DMA_TRIGGER_SOURCE eventSrc)
DMA_CHANNEL PLIB_DMA_CRCChannelGet(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticeEdgeStatus(PORTS_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
SYS_DMA_CRC_WRITE_ORDER
Definition: inszt_UART.c:13267
size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
void DRV_TMR3_StopInIdleEnable(void)
uint8_t cmd_size
Definition: commands.h:76
bool DRV_TMR4_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
void PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SYS_MODULE_OBJ DRV_USART_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
bool PLIB_USART_ExistsTransmitterEnable(USART_MODULE_ID index)
void SYS_PORTS_ChangeNotificationEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum, SYS_PORTS_PULLUP_PULLDOWN_STATUS value)
DRV_SPI_PROTOCOL_TYPE
Definition: inszt_UART.c:26276
bool DRV_TMR0_Start(void)
bool PLIB_SPI_ExistsReceiveFIFOStatus(SPI_MODULE_ID index)
PORTS_DATA_TYPE SYS_PORTS_LatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_USART_ReceiverIdleStateLowEnable(USART_MODULE_ID index)
void SYS_PORTS_ChangeNotificationInIdleModeDisable(PORTS_MODULE_ID index)
void(* DRV_SPI_BUFFER_EVENT_HANDLER)(DRV_SPI_BUFFER_EVENT event, DRV_SPI_BUFFER_HANDLE bufferHandle, void *context)
Definition: inszt_UART.c:26424
bool PLIB_DMA_ExistsChannelX(DMA_MODULE_ID index)
uint16_t PORTS_DATA_MASK
Definition: inszt_adc.c:18519
void DRV_USART0_Deinitialize(void)
void PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
PORTS_DATA_TYPE PLIB_PORTS_ReadLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_USART_WakeOnStartDisable(USART_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_MODULE_ID index)
#define FILEPOINT
Definition: inszt_UART.c:92
SPI_FRAME_PULSE_POLARITY framePulsePolarity
Definition: inszt_adc.c:26551
DRV_USART_BUFFER_EVENT
Definition: inszt_UART.c:15005
bool PLIB_DMA_ExistsChannelXSourceSize(DMA_MODULE_ID index)
bool PLIB_SPI_IsBusy(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXEvent(DMA_MODULE_ID index)
void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
uint32_t DRV_TMR_CounterFrequencyGet(DRV_HANDLE handle)
void DRV_TMR_Deinitialize(SYS_MODULE_OBJ object)
void PLIB_SPI_AudioProtocolEnable(SPI_MODULE_ID index)
void PLIB_SPI_BufferWrite16bit(SPI_MODULE_ID index, uint16_t data)
void PLIB_USART_WakeOnStartEnable(USART_MODULE_ID index)
TMR_PRESCALE DRV_TMR4_PrescalerGet(void)
void PLIB_SPI_FIFOEnable(SPI_MODULE_ID index)
uint32_t DRV_TMR3_PeriodValueGet(void)
void DRV_USART_Deinitialize(SYS_MODULE_OBJ object)
UART_STATES state
Definition: inszt_app.c:30648
DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
void PLIB_DMA_ChannelXPeripheralAddressSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t peripheraladdress)
void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
void PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
DRV_HANDLE DRV_USART0_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
DRV_ADC_MODULE_ID
Definition: inszt_UART.c:1418
DRV_SPI_MODE
Definition: inszt_UART.c:26330
DRV_SPI_PROTOCOL_TYPE
Definition: inszt_adc.c:26367
bool PLIB_SPI_FIFOShiftRegisterIsEmpty(SPI_MODULE_ID index)
bool PLIB_USART_ExistsTransmitter9BitsSend(USART_MODULE_ID index)
DRV_USART_LINE_CONTROL_SET_RESULT
Definition: inszt_adc.c:15287
void DRV_TMR3_CounterClear(void)
void DRV_USART_TasksReceive(SYS_MODULE_OBJ object)
void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
DRV_TMR_CLIENT_STATUS DRV_TMR1_ClientStatus(void)
DRV_CLIENT_STATUS
Definition: inszt_UART.c:928
void PLIB_PORTS_PinModePerPortSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_MODE mode)
static void Execute_Protocol_A(void)
bool PLIB_DMA_LastBusAccessIsWrite(DMA_MODULE_ID index)
uint32_t DRV_TMR3_CounterFrequencyGet(void)
bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_DMA_ExistsChannelXDisabled(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXReloadDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_Disable(DMA_MODULE_ID index)
void SYS_PORTS_PinPullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
bool write_complete
Definition: inszt_app.c:30650
void * PLIB_USART_ReceiverAddressGet(USART_MODULE_ID index)
void PLIB_SPI_FrameSyncPulseDirectionSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_DIRECTION direction)
void PLIB_DMA_ChannelXChainDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_ExistsPortsWrite(PORTS_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
uint32_t SYS_DMA_ChannelCRCGet(void)
static void qqoutput3(FILEPOINT char *s, int i, int j, int k)
Definition: inszt_UART.c:28775
void DRV_USART0_Close(void)
void SYS_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
DRV_USART_LINE_CONTROL
Definition: inszt_adc.c:15315
bool PLIB_SPI_ExistsBaudRateClock(SPI_MODULE_ID index)
uint8_t PLIB_SPI_FIFOCountGet(SPI_MODULE_ID index, SPI_FIFO_TYPE type)
uint32_t DRV_TMR0_PeriodValueGet(void)
void(* DRV_USART_BYTE_EVENT_HANDLER)(const SYS_MODULE_INDEX index)
Definition: inszt_UART.c:15137
bool DRV_USART_TransmitBufferIsFull(const DRV_HANDLE handle)
DRV_TMR_CLIENT_STATUS DRV_TMR3_ClientStatus(void)
void PLIB_DMA_CRCEnable(DMA_MODULE_ID index)
DRV_USART_BAUD_SET_RESULT
Definition: inszt_adc.c:15266
void PLIB_DMA_ChannelXAbortIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQ)
bool PLIB_SPI_ExistsBaudRate(SPI_MODULE_ID index)
bool PLIB_USART_ExistsOperationMode(USART_MODULE_ID index)
void DRV_TMR4_CounterValueSet(uint32_t value)
void PLIB_DMA_BusyActiveReset(DMA_MODULE_ID index)
SYS_MODULE_OBJ DRV_TMR_Initialize(const SYS_MODULE_INDEX drvIndex, const SYS_MODULE_INIT *const init)
uint32_t PLIB_DMA_CRCDataRead(DMA_MODULE_ID index)
void DRV_TMR4_Stop(void)
static int UART_71zqzqzq(int qqqi)
Definition: inszt_UART.c:28952
void PLIB_DMA_ChannelXPatternLengthSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_PATTERN_LENGTH patternLen)
Definition: fifo.h:59
void PLIB_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_USART_BaudRateAutoDetectEnable(USART_MODULE_ID index)
bool PLIB_DMA_ExistsSuspend(DMA_MODULE_ID index)
bool PLIB_SPI_Exists32bitBuffer(SPI_MODULE_ID index)
COMM_STATES
Definition: commmodule.h:55
static int UART_71zscanf(char *qqscan_str)
Definition: inszt_UART.c:28698
void PLIB_DMA_ChannelXBusyInActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint8_t PLIB_DMA_ChannelBitsGet(DMA_MODULE_ID index)
void DRV_TMR_CounterClear(DRV_HANDLE handle)
uint8_t PLIB_DMA_ChannelXPatternIgnoreGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsBaudRate(USART_MODULE_ID index)
bool PLIB_SPI_ExistsAudioProtocolControl(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXSourceAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_SOURCE_ADDRESSING_MODE sourceAddressMode)
#define QQQnumfil
Definition: inszt_UART.c:51
void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index, int8_t Mask)
DMA_CHANNEL_INT_SOURCE PLIB_DMA_ChannelXTriggerSourceNumberGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXDestinationAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode)
SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void)
void SYS_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint8_t jobQueueReserveSize
Definition: inszt_adc.c:26596
void DRV_TMR2_CounterClear(void)
bool PLIB_DMA_ExistsChannelXChainEnbl(DMA_MODULE_ID index)
static int UART_71zqqzqz(qqnull_params)
Definition: inszt_UART.c:28832
void SYS_DMA_ChannelSetup(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OP_MODE modeEnable, DMA_TRIGGER_SOURCE eventSrc)
bool PLIB_USART_ModuleIsBusy(USART_MODULE_ID index)
DRV_TMR_CLIENT_STATUS
Definition: inszt_adc.c:1801
void PLIB_PORTS_DirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_PORTS_ExistsChangeNotice(PORTS_MODULE_ID index)
DRV_USART_TRANSFER_STATUS DRV_USART0_TransferStatus(void)
SYS_MODULE_INIT moduleInit
Definition: inszt_adc.c:26535
bool PLIB_SPI_ExistsReceiverOverflow(SPI_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
struct _DRV_SPI_CLIENT_DATA DRV_SPI_CLIENT_DATA
void PLIB_DMA_CRCXOREnableSet(DMA_MODULE_ID index, uint32_t DMACRCXOREnableMask)
static int qqqqbmselwidth
Definition: inszt_UART.c:49
SYS_DMA_ERROR
Definition: inszt_UART.c:13400
bool PLIB_PORTS_ExistsChannelChangeNoticeMethod(PORTS_MODULE_ID index)
bool PLIB_USART_ExistsTransmitterInterruptMode(USART_MODULE_ID index)
uint8_t bytes_received
Definition: inszt_app.c:30654
static int tbrun_mode
Definition: inszt_UART.c:97
void SYS_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_ADC_DeInitialize(void)
SYS_STATUS DRV_TMR_Status(SYS_MODULE_OBJ object)
void PLIB_DMA_ChannelXTriggerEnable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint8_t Fifo_Put(TFifo *ptrFifo, uint8_t Data)
Definition: fifo.c:117
#define qqnull_params
Definition: inszt_UART.c:28677
bool PLIB_USART_ExistsReceiverAddressDetect(USART_MODULE_ID index)
void PLIB_USART_BaudRateSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
void DRV_PMP0_Write(uint8_t data)
bool PLIB_PORTS_ExistsChangeNoticePerPortInIdle(PORTS_MODULE_ID index)
void PLIB_DMA_StartTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void DRV_TMR3_Open(void)
Definition: inszt_UART.c:3963
void PLIB_PORTS_PinDirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
unsigned int DRV_USART_TransmitBufferSizeGet(const DRV_HANDLE handle)
static int qqqisinitialised
Definition: inszt_main.c:152
bool PLIB_SPI_TransmitBufferIsEmpty(SPI_MODULE_ID index)
DRV_SPI_TASK_MODE
Definition: inszt_adc.c:26444
bool PLIB_PORTS_ExistsPinModePerPort(PORTS_MODULE_ID index)
bool PLIB_USART_ExistsBaudRateHigh(USART_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXCellSize(DMA_MODULE_ID index)
static SYS_STATUS DRV_TMR2_Status(void)
Definition: inszt_UART.c:3842
bool PLIB_DMA_ExistsChannelXTrigger(DMA_MODULE_ID index)
void DRV_TMR_AlarmEnable(DRV_HANDLE handle, bool enable)
DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus(DRV_SPI_BUFFER_HANDLE bufferHandle)
void PLIB_DMA_ChannelXChainEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint32_t DRV_TMR0_CounterValueGet(void)
bool PLIB_USART_ReceiverAddressIsReceived(USART_MODULE_ID index)
void PLIB_DMA_ChannelXTriggerDisable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
void PLIB_USART_TransmitterBreakSend(USART_MODULE_ID index)
DRV_USART_TRANSFER_STATUS
Definition: inszt_UART.c:15398
PORTS_DATA_TYPE PLIB_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_USART_AddressSet(USART_MODULE_ID index, uint8_t address)
int8_t PLIB_USART_ReceiverByteReceive(USART_MODULE_ID index)
void PLIB_DMA_StopInIdleEnable(DMA_MODULE_ID index)
static void Execute_Auto_Protocol_A(void)
void PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static void DRV_TMR0_DeInitialize(void)
Definition: inszt_UART.c:3613
void PLIB_USART_StopInIdleDisable(USART_MODULE_ID index)
DRV_USART_ERROR DRV_USART0_ErrorGet(void)
uint32_t DRV_TMR_AlarmPeriodGet(DRV_HANDLE handle)
void PLIB_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
INT_SOURCE txInterruptSource
Definition: inszt_adc.c:26580
bool PLIB_SPI_ExistsEnableControl(SPI_MODULE_ID index)
DRV_SPI_BUFFER_TYPE
Definition: inszt_adc.c:26344
PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void UART_Tasks(void)
Definition: inszt_UART.c:28419
bool DRV_ADC_SamplesAvailable(uint8_t bufIndex)
static DRV_TMR_OPERATION_MODE DRV_TMR3_OperationModeGet(void)
Definition: inszt_UART.c:3974
static void DRV_TMR1_Tasks(void)
Definition: inszt_UART.c:3804
int QQQfcn_ptr_num
Definition: inszt_main.c:151
void PLIB_SPI_AudioTransmitModeSelect(SPI_MODULE_ID index, SPI_AUDIO_TRANSMIT_MODE mode)
DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ExistsChannelXINTSourceFlag(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsPortsOpenDrain(PORTS_MODULE_ID index)
void PLIB_DMA_ChannelPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL_PRIORITY channelPriority)
void DRV_ADC1_Open(void)
uint16_t PLIB_DMA_ChannelXSourcePointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
uint32_t DRV_TMR1_PeriodValueGet(void)
unsigned int DRV_USART0_ReceiverBufferSizeGet(void)
uint16_t PLIB_DMA_ChannelXCellProgressPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
uint8_t PLIB_SPI_BufferRead(SPI_MODULE_ID index)
uint32_t DRV_TMR1_CounterFrequencyGet(void)
void PLIB_SPI_PinDisable(SPI_MODULE_ID index, SPI_PIN pin)
void PLIB_DMA_ChannelXReloadEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_OutputDataPhaseSelect(SPI_MODULE_ID index, SPI_OUTPUT_DATA_PHASE phase)
void DRV_ADC_Start(void)
DRV_SPI_BUFFER_EVENT
Definition: inszt_adc.c:26399
void PLIB_SPI_FramedCommunicationDisable(SPI_MODULE_ID index)
DRV_USART_TRANSFER_STATUS
Definition: inszt_adc.c:15489
DRV_TMR_OPERATION_MODE
Definition: inszt_adc.c:1848
void PLIB_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
void PLIB_DMA_CRCTypeSet(DMA_MODULE_ID index, DMA_CRC_TYPE CRCType)
SYS_DMA_CHANNEL_IGNORE_MATCH
Definition: inszt_adc.c:13316
SPI_FRAME_PULSE_DIRECTION framePulseDirection
Definition: inszt_adc.c:26553
void SYS_PORTS_InterruptEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_INTERRUPT_TYPE pinInterruptType)
void DRV_TMR1_CounterClear(void)
void PLIB_DMA_ChannelXEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsClockPolarity(SPI_MODULE_ID index)
uint16_t PORTS_DATA_MASK
Definition: inszt_UART.c:18428
void DRV_IC0_Stop(void)
void PLIB_SPI_FrameSyncPulseCounterSelect(SPI_MODULE_ID index, SPI_FRAME_SYNC_PULSE pulse)
bool PLIB_DMA_ExistsCRCType(DMA_MODULE_ID index)
bool PLIB_USART_ExistsReceiverInterruptMode(USART_MODULE_ID index)
SYS_DMA_ERROR
Definition: inszt_adc.c:13491
bool PLIB_PORTS_ExistsPortsDirection(PORTS_MODULE_ID index)
void PLIB_USART_BaudRateHighDisable(USART_MODULE_ID index)
void PLIB_PORTS_ChannelSlewRateSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK channelMask, PORTS_PIN_SLEW_RATE slewRate)
uint32_t dummyByteValue
Definition: inszt_adc.c:26589
void(* DRV_TMR_CALLBACK)(uintptr_t context, uint32_t alarmCount)
Definition: inszt_UART.c:1837
bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
void PLIB_DMA_CRCAppendModeEnable(DMA_MODULE_ID index)
SYS_DMA_SIDL
Definition: inszt_adc.c:13275
void PLIB_USART_BRGClockSourceSelect(USART_MODULE_ID index, USART_BRG_CLOCK_SOURCE brgClockSource)
bool PLIB_DMA_ChannelXBufferedDataIsWritten(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void DRV_TMR3_Close(void)
Definition: inszt_UART.c:3984
void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index, SPI_AUDIO_PROTOCOL mode)
bool PLIB_SPI_ExistsTransmitBufferEmptyStatus(SPI_MODULE_ID index)
void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
DRV_USART_LINE_CONTROL
Definition: inszt_UART.c:15224
#define UART_71zzopen
Definition: inszt_UART.c:77
SYS_DMA_CHANNEL_CRC_MODE
Definition: inszt_adc.c:13335
bool PLIB_SPI_ExistsReceiveBufferStatus(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXPatternIgnoreByte(DMA_MODULE_ID index)
void SYS_PORTS_PinDirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SYSTEM_OBJECTS sysObj
bool PLIB_USART_ReceiverDataIsAvailable(USART_MODULE_ID index)
uintptr_t DRV_HANDLE
Definition: inszt_adc.c:1108
DRV_TMR_OPERATION_MODE DRV_TMR1_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
DRV_SPI_PROTOCOL_TYPE spiProtocolType
Definition: inszt_adc.c:26545
void SYS_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
bool PLIB_SPI_ExistsCommunicationWidth(SPI_MODULE_ID index)
void PLIB_USART_ReceiverIdleStateLowDisable(USART_MODULE_ID index)
void PLIB_SPI_Enable(SPI_MODULE_ID index)
void DRV_TMR1_Initialize(void)
SPI_FRAME_PULSE_WIDTH framePulseWidth
Definition: inszt_adc.c:26557
bool PLIB_DMA_IsEnabled(DMA_MODULE_ID index)
static UART_STATES U_STATES
Definition: inszt_UART.c:28402
bool PLIB_DMA_ExistsChannelXDestinationSize(DMA_MODULE_ID index)
DRV_USART_CLIENT_STATUS
Definition: inszt_UART.c:15373
void PLIB_USART_LoopbackEnable(USART_MODULE_ID index)
DRV_SPI_BUFFER_EVENT
Definition: inszt_UART.c:26308
void PLIB_USART_BaudRateHighEnable(USART_MODULE_ID index)
bool PLIB_USART_ExistsTransmitterIdleIsLow(USART_MODULE_ID index)
void PLIB_DMA_CRCBitOrderSelect(DMA_MODULE_ID index, DMA_CRC_BIT_ORDER bitOrder)
TMR_PRESCALE DRV_TMR1_PrescalerGet(void)
void DRV_TMR_Tasks(SYS_MODULE_OBJ object)
static void DRV_TMR4_Open(void)
Definition: inszt_UART.c:4073
void SYS_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION function, PORTS_REMAP_OUTPUT_PIN remapPin)
TFifo TX_FIFO
Definition: fifo.c:48
uint32_t baudRate
Definition: inszt_adc.c:26572
void PLIB_PORTS_CnPinsEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
bool PLIB_PORTS_ExistsChangeNoticeInIdle(PORTS_MODULE_ID index)
bool PLIB_DMA_IsBusy(DMA_MODULE_ID index)
TFifo RX_FIFO
Definition: fifo.c:47
TMR_PRESCALE DRV_TMR2_PrescalerGet(void)
void PLIB_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
void SYS_DEBUG_Tasks(SYS_MODULE_OBJ object)
void PLIB_USART_BaudSetAndEnable(USART_MODULE_ID index, uint32_t systemClock, uint32_t baud)
void DRV_TMR0_Initialize(void)
void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
DRV_IO_INTENT
Definition: inszt_UART.c:884
bool DRV_SPIn_TransmitterBufferIsFull(void)
bool PLIB_SPI_ExistsAudioTransmitMode(SPI_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXDestinationSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
SYS_PORTS_PIN_DIRECTION
Definition: inszt_UART.c:21797
void PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void PLIB_PORTS_PinDirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_PORTS_PinGetLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_USART_TasksError(SYS_MODULE_OBJ object)
bool PLIB_DMA_ExistsRecentAddress(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXPatternIgnore(DMA_MODULE_ID index)
SYS_MODULE_OBJ DRV_USART0_Initialize(void)
void PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
unsigned char uchar8_t
Definition: commands.h:52
uint32_t DRV_TMR4_CounterValueGet(void)
void PLIB_USART_TransmitterEnable(USART_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
uintptr_t SYS_DMA_CHANNEL_HANDLE
Definition: inszt_UART.c:13158
bool DRV_TMR_GateModeClear(DRV_HANDLE handle)
size_t DRV_USART_BufferProcessedSizeGet(DRV_USART_BUFFER_HANDLE bufferHandle)
USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet(USART_MODULE_ID index)
SYS_PORTS_PIN_DIRECTION
Definition: inszt_adc.c:21888
bool DRV_TMR1_Start(void)
static int UART_71zqendz(int qqqi)
Definition: inszt_UART.c:28867
bool PLIB_USART_ExistsReceiverDataAvailableStatus(USART_MODULE_ID index)
bool PLIB_USART_ExistsModuleBusyStatus(USART_MODULE_ID index)
void * PLIB_USART_TransmitterAddressGet(USART_MODULE_ID index)
bool PLIB_DMA_ExistsAbortTransfer(DMA_MODULE_ID index)
void PLIB_DMA_CRCDataWrite(DMA_MODULE_ID index, uint32_t DMACRCdata)
bool PLIB_DMA_ExistsCRCChannel(DMA_MODULE_ID index)
static void DRV_TMR2_Close(void)
Definition: inszt_UART.c:3874
void PLIB_USART_RunInSleepModeEnable(USART_MODULE_ID index)
void * PLIB_SPI_BufferAddressGet(SPI_MODULE_ID index)
void PLIB_SPI_StopInIdleDisable(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePullDownPerPort(PORTS_MODULE_ID index)
DRV_IO_BUFFER_TYPES
Definition: inszt_UART.c:985
void DRV_TMR_AlarmDeregister(DRV_HANDLE handle)
bool DRV_USART0_ReceiverBufferIsEmpty(void)
void PLIB_DMA_ChannelXAutoDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_CRCChannelSelect(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
void DRV_USART_Close(const DRV_HANDLE handle)
COMMAND_STATES
Definition: inszt_UART.c:28156
void PLIB_DMA_CRCByteOrderSelect(DMA_MODULE_ID index, DMA_CRC_BYTE_ORDER byteOrder)
void PLIB_SPI_FrameSyncPulseWidthSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_WIDTH width)
void DRV_ADC_Initialize(void)
void qqqtotalreset(void)
Definition: inszt_main.c:7067
bool PLIB_SPI_ExistsSlaveSelectControl(SPI_MODULE_ID index)
void PLIB_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
bool PLIB_DMA_ExistsCRCData(DMA_MODULE_ID index)
bool PLIB_USART_ExistsTransmitter(USART_MODULE_ID index)
void DRV_TMR_AlarmPeriodSet(DRV_HANDLE handle, uint32_t value)
bool PLIB_DMA_ExistsChannelXDestinationStartAddress(DMA_MODULE_ID index)
void PLIB_DMA_ChannelXINTSourceEnable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void PLIB_SPI_BaudRateClockSelect(SPI_MODULE_ID index, SPI_BAUD_RATE_CLOCK type)
void PLIB_PORTS_CnPinsDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void PLIB_SPI_BufferClear(SPI_MODULE_ID index)
void PLIB_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
void PLIB_USART_RunInOverflowEnable(USART_MODULE_ID index)
static void Execute_System(void)
bool PLIB_DMA_ExistsStartTransfer(DMA_MODULE_ID index)
DRV_USART_HANDSHAKE
Definition: inszt_adc.c:15241
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet(DMA_MODULE_ID index)
DRV_SPI_MODE
Definition: inszt_adc.c:26421
bool PLIB_PORTS_ExistsPinChangeNoticePerPort(PORTS_MODULE_ID index)
void PLIB_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool DRV_TMR3_Start(void)
void PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
DRV_SPI_BUFFER_TYPE bufferType
Definition: inszt_adc.c:26574
DRV_USART_CLIENT_STATUS DRV_USART0_ClientStatus(void)
int qqupload_registered
Definition: inszt_main.c:6760
PORTS_PIN_INTERRUPT_TYPE
Definition: inszt_UART.c:21812
void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index, USART_HANDSHAKE_MODE handshakeConfig)
bool PLIB_SPI_ExistsFrameSyncPulseDirection(SPI_MODULE_ID index)
SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT *const init)
bool PLIB_DMA_ExistsChannelXStartIRQ(DMA_MODULE_ID index)
static void qqbmsoutput(FILEPOINT char *s, unsigned int i)
Definition: inszt_UART.c:28904
void PLIB_SPI_FIFOInterruptModeSelect(SPI_MODULE_ID index, SPI_FIFO_INTERRUPT mode)
void PLIB_DMA_ChannelXSourceStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t sourceStartAddress)
void PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
bool DRV_SPIn_ReceiverBufferIsFull(void)
bool PLIB_PORTS_ExistsRemapInput(PORTS_MODULE_ID index)
bool PLIB_SPI_ExistsFrameSyncPulseEdge(SPI_MODULE_ID index)
DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR2_StopInIdleDisable(void)
void DRV_TMR4_PeriodValueSet(uint32_t value)
void SYS_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_PORTS_DirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR2_Stop(void)
DRV_TMR_OPERATION_MODE DRV_TMR0_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void PLIB_DMA_ChannelXDataSizeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_DATA_SIZE channelDataSize)
bool PLIB_USART_RunInSleepModeIsEnabled(USART_MODULE_ID index)
DRV_USART_CLIENT_STATUS
Definition: inszt_adc.c:15464
bool PLIB_SPI_ExistsStopInIdleControl(SPI_MODULE_ID index)
void PLIB_DMA_CRCAppendModeDisable(DMA_MODULE_ID index)
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART_LineControlSet(const DRV_HANDLE client, const DRV_USART_LINE_CONTROL lineControl)
void COMMAND_Tasks(void)
Definition: commands.c:225
void(* ldra_void_function)()
Definition: inszt_UART.c:115
bool PLIB_USART_ExistsBaudRateAutoDetect(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsPinMode(PORTS_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePullUp(PORTS_MODULE_ID index)
DRV_HANDLE handleUSART0
Definition: inszt_app.c:30649
static int qqqstructzzopen
Definition: inszt_UART.c:137
DRV_IO_INTENT
Definition: inszt_adc.c:975
bool PLIB_DMA_ExistsChannelBits(DMA_MODULE_ID index)
bool PLIB_USART_ExistsReceiverIdleStateLowEnable(USART_MODULE_ID index)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26603
bool PLIB_SPI_ExistsAudioCommunicationWidth(SPI_MODULE_ID index)
void DRV_SPI_Close(DRV_HANDLE handle)
bool DRV_TMR1_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
void PLIB_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_ExistsChannelXSourceStartAddress(DMA_MODULE_ID index)
void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index, USART_LINECONTROL_MODE dataFlowConfig)
void DRV_TMR0_CounterClear(void)
bool PLIB_PORTS_ExistsPinChangeNotice(PORTS_MODULE_ID index)
static int zzfileid
Definition: inszt_UART.c:50
static DRV_TMR_OPERATION_MODE DRV_TMR4_OperationModeGet(void)
Definition: inszt_UART.c:4084
void PLIB_SPI_BufferWrite(SPI_MODULE_ID index, uint8_t data)
DRV_TMR_CLK_SOURCES
Definition: inszt_UART.c:1603
void DRV_USART0_TasksTransmit(void)
struct _DRV_SPI_INIT DRV_SPI_INIT
void PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_MODULE_ID index)
bool PLIB_DMA_ExistsCRCAppendMode(DMA_MODULE_ID index)
static void qqoutput4(FILEPOINT char *s, int i, int j, int k, int l)
Definition: inszt_UART.c:28784
static SYS_STATUS DRV_TMR1_Status(void)
Definition: inszt_UART.c:3732
void PLIB_SPI_FrameSyncPulseEdgeSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_EDGE edge)
DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus(DRV_HANDLE handle)
void PLIB_DMA_CRCWriteByteOrderMaintain(DMA_MODULE_ID index)
bool PLIB_USART_ExistsEnable(USART_MODULE_ID index)
void PLIB_USART_RunInSleepModeDisable(USART_MODULE_ID index)
bool PLIB_DMA_ChannelXNullWriteModeIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint16_t PLIB_DMA_ChannelXPatternDataGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_PORTS_ExistsChangeNoticePullUpPerPort(PORTS_MODULE_ID index)
bool PLIB_DMA_CRCIsEnabled(DMA_MODULE_ID index)
void SYS_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void qqqtotalupload(void)
Definition: inszt_main.c:7054
uint32_t PLIB_USART_BaudRateGet(USART_MODULE_ID index, int32_t clockFrequency)
static void qqqqinitialise(int ii)
Definition: inszt_UART.c:28799
void DRV_TMR0_PeriodValueSet(uint32_t value)
SYS_DMA_CHANNEL_OP_MODE
Definition: inszt_adc.c:13381
SPI_FRAME_PULSE_EDGE framePulseEdge
Definition: inszt_adc.c:26555
bool PLIB_DMA_ChannelXAutoIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool DRV_TMR0_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
DRV_USART_INIT_FLAGS
Definition: inszt_UART.c:15273
void SYS_PORTS_ChangeNotificationDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
void SYS_PORTS_ChangeNotificationPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
uintptr_t DRV_HANDLE
Definition: inszt_UART.c:1017
void DRV_USART0_WriteByte(const uint8_t byte)
bool PLIB_USART_ExistsReceiverAddressMask(USART_MODULE_ID index)
void SYS_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
void PLIB_USART_ReceiverDisable(USART_MODULE_ID index)
bool PLIB_USART_ExistsStopInIdle(USART_MODULE_ID index)
uint8_t Fifo_Get(TFifo *ptrFifo)
Definition: fifo.c:160
SPI_MODULE_ID spiId
Definition: inszt_adc.c:26537
bool PLIB_PORTS_ExistsSlewRateControl(PORTS_MODULE_ID index)
void SYS_DEBUG_Reinitialize(SYS_MODULE_OBJ object, const SYS_MODULE_INIT *const init)
void PLIB_SPI_ErrorInterruptDisable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
bool PLIB_USART_ExistsIrDA(USART_MODULE_ID index)
void SYS_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_PORTS_CnPinsPullUpDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
uint16_t DRV_IC0_Capture16BitDataRead(void)
void PLIB_DMA_ChannelXBusyActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR3_CounterValueSet(uint32_t value)
void PLIB_DMA_ChannelXStartAddressOffsetSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t address, DMA_ADDRESS_OFFSET_TYPE offset)
uint32_t DRV_TMR0_CounterFrequencyGet(void)
DRV_TMR_OPERATION_MODE DRV_TMR3_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void PLIB_DMA_ChannelXPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_PRIORITY channelPriority)
bool PLIB_DMA_LastBusAccessIsRead(DMA_MODULE_ID index)
void SYS_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
void DRV_USART_ByteErrorCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
void qqpopulate_array_fcn_ptrQQ(int x, ldra_void_function y, ldra_void_function z)
Definition: inszt_main.c:157
void PLIB_DMA_ChannelXDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsReadDataSignStatus(SPI_MODULE_ID index)
void DRV_USART_AddressedBufferAddWrite(const DRV_HANDLE hClient, DRV_USART_BUFFER_HANDLE *bufferHandle, uint8_t address, void *source, size_t nWords)
static void DRV_TMR3_DeInitialize(void)
Definition: inszt_UART.c:3943
bool PLIB_DMA_ExistsCRCWriteByteOrder(DMA_MODULE_ID index)
void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus(SPI_MODULE_ID index)
bool PLIB_USART_ExistsRunInSleepMode(USART_MODULE_ID index)
TMR_PRESCALE DRV_TMR3_PrescalerGet(void)
static void ReadUART(void)
Definition: inszt_UART.c:28553
static SYS_STATUS DRV_TMR3_Status(void)
Definition: inszt_UART.c:3952
void DRV_TMR2_StopInIdleEnable(void)
static void WriteUART(void)
Definition: inszt_UART.c:28597
uint32_t PLIB_DMA_CRCXOREnableGet(DMA_MODULE_ID index)
uint32_t DRV_IC0_Capture32BitDataRead(void)
SYS_ERROR_LEVEL
Definition: inszt_adc.c:17548
DRV_HANDLE DRV_USART_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
bool PLIB_USART_ExistsBRGClockSourceSelect(USART_MODULE_ID index)
uintptr_t DRV_USART_BUFFER_HANDLE
Definition: inszt_adc.c:15035
bool PLIB_DMA_ExistsChannelXSourcePointer(DMA_MODULE_ID index)
void SYS_DMA_ChannelTransferSet(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
size_t DRV_USART_Read(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index, SPI_INPUT_SAMPLING_PHASE phase)
bool usage
Definition: inszt_app.c:30651
void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
void PLIB_SPI_AudioErrorDisable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
bool PLIB_USART_TransmitterIsEmpty(USART_MODULE_ID index)
bool PLIB_DMA_ChannelXEventIsDetected(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ExistsChannelXPriority(DMA_MODULE_ID index)
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART0_LineControlSet(DRV_USART_LINE_CONTROL lineControlMode)
void PLIB_USART_ReceiverOverrunErrorClear(USART_MODULE_ID index)
SYS_STATUS DRV_USART_Status(SYS_MODULE_OBJ object)
void PLIB_DMA_ChannelXChainToHigher(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void DRV_TMR2_Tasks(void)
Definition: inszt_UART.c:3914
void COMM_Tasks(void)
Definition: commmodule.c:88
bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
SYS_MODULE_OBJ SYS_DEBUG_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
bool PLIB_DMA_CRCAppendModeIsEnabled(DMA_MODULE_ID index)
static void DRV_TMR1_Close(void)
Definition: inszt_UART.c:3764
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
bool PLIB_USART_TransmitterBufferIsFull(USART_MODULE_ID index)
bool PLIB_SPI_ExistsFIFOCount(SPI_MODULE_ID index)
void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
PORTS_DATA_MASK SYS_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26610
void PLIB_USART_Enable(USART_MODULE_ID index)
bool PLIB_SPI_ExistsFrameErrorStatus(SPI_MODULE_ID index)
void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
SYS_STATUS DRV_USART0_Status(void)
void SYS_DMA_Suspend(void)
void PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
SYS_DMA_CHANNEL_OP_MODE
Definition: inszt_UART.c:13290
void PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
CLK_BUSES_PERIPHERAL spiClk
Definition: inszt_adc.c:26570
bool PLIB_USART_WakeOnStartIsEnabled(USART_MODULE_ID index)
bool PLIB_USART_ExistsReceiverFramingErrorStatus(USART_MODULE_ID index)
void SYS_DMA_ChannelTransferEventHandlerSet(SYS_DMA_CHANNEL_HANDLE handle, const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler, const uintptr_t contextHandle)
bool SYS_DMA_IsBusy(void)
DRV_USART_LINE_CONTROL_SET_RESULT
Definition: inszt_UART.c:15196
unsigned char uchar8_t
Definition: inszt_UART.c:28148
void SYS_PORTS_DirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
static DRV_TMR_OPERATION_MODE DRV_TMR2_OperationModeGet(void)
Definition: inszt_UART.c:3864
bool PLIB_SPI_ReceiverBufferIsFull(SPI_MODULE_ID index)
void PLIB_USART_RunInOverflowDisable(USART_MODULE_ID index)
bool PLIB_USART_ExistsHandshakeMode(USART_MODULE_ID index)
bool PLIB_USART_ExistsTransmitterBufferFullStatus(USART_MODULE_ID index)
void SYS_PORTS_Initialize()
void PLIB_DMA_ChannelXPatternDataSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t patternData)
void DRV_TMR3_Stop(void)
SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate(DMA_CHANNEL channel)
void PLIB_DMA_AbortTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
UART_DATA UART
Definition: inszt_UART.c:28399
static unsigned char qqqzzglobflag
Definition: inszt_UART.c:167
void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
SPI_COMMUNICATION_WIDTH commWidth
Definition: inszt_adc.c:26563
bool PLIB_DMA_ExistsChannelXAbortIRQ(DMA_MODULE_ID index)
bool PLIB_SPI_Exists16bitBuffer(SPI_MODULE_ID index)
DRV_USART_BUFFER_RESULT
Definition: inszt_UART.c:15027
void DRV_TMR2_PeriodValueSet(uint32_t value)
SYS_DMA_TRANSFER_EVENT
Definition: inszt_UART.c:13378
void PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod)
void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index, SPI_CLOCK_POLARITY polarity)
static void qqqbitmapreset(qqnull_params)
bool PLIB_USART_BaudRateAutoDetectIsComplete(USART_MODULE_ID index)
static SYS_STATUS DRV_TMR4_Status(void)
Definition: inszt_UART.c:4062
bool PLIB_PORTS_ChangeNoticePerPortHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
#define DRV_IC_Close(handle)
Definition: inszt_UART.c:1327
bool PLIB_USART_ReceiverIsIdle(USART_MODULE_ID index)
void PLIB_DMA_SuspendDisable(DMA_MODULE_ID index)
DRV_TMR_CLIENT_STATUS DRV_TMR2_ClientStatus(void)
static DRV_TMR_OPERATION_MODE DRV_TMR0_OperationModeGet(void)
Definition: inszt_UART.c:3644
APP_DATA APP
Definition: app.c:73
static SYS_STATUS DRV_TMR0_Status(void)
Definition: inszt_UART.c:3622
void PLIB_SPI_AudioErrorEnable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove(DRV_USART_BUFFER_HANDLE bufferHandle)
bool PLIB_USART_ExistsReceiverParityErrorStatus(USART_MODULE_ID index)
bool PLIB_USART_RunInOverflowIsEnabled(USART_MODULE_ID index)
DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint32_t PORTS_DATA_TYPE
Definition: inszt_UART.c:18441
DRV_TMR_OPERATION_MODE DRV_TMR2_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
COMM_STATES
Definition: inszt_UART.c:28004
uint32_t PORTS_DATA_TYPE
Definition: inszt_adc.c:18532
static void DRV_TMR1_DeInitialize(void)
Definition: inszt_UART.c:3723
bool PLIB_DMA_ChannelXReloadIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_TransmitterInterruptModeSelect(USART_MODULE_ID index, USART_TRANSMIT_INTR_MODE fifolevel)
DRV_USART_OPERATION_MODE
Definition: inszt_adc.c:15059
DRV_TMR_CLIENT_STATUS DRV_TMR0_ClientStatus(void)
bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus(const DRV_HANDLE handle)
DRV_USART_ERROR
Definition: inszt_adc.c:15426
DRV_USART_HANDSHAKE
Definition: inszt_UART.c:15150
bool DRV_TMR2_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
DRV_USART_BAUD_SET_RESULT
Definition: inszt_UART.c:15175
uint8_t queueSize
Definition: inszt_adc.c:26592
static void DRV_TMR2_Open(void)
Definition: inszt_UART.c:3853
static void DRV_TMR0_Close(void)
Definition: inszt_UART.c:3654
void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
bool DRV_IC0_BufferIsEmpty(void)
int qqqshell_upload
Definition: inszt_main.c:150
void PLIB_PORTS_CnPinsPullUpEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
static void qqoutput(FILEPOINT char *s, int i)
Definition: inszt_UART.c:28745
SYS_PORTS_PULLUP_PULLDOWN_STATUS
Definition: inszt_adc.c:21864
bool PLIB_SPI_ExistsAudioErrorControl(SPI_MODULE_ID index)
void PLIB_SPI_StopInIdleEnable(SPI_MODULE_ID index)
bool PLIB_DMA_ChannelXIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR3_PeriodValueSet(uint32_t value)
bool PLIB_DMA_ChannelXBusyIsBusy(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_Disable(SPI_MODULE_ID index)
uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
#define qqqbranches
Definition: inszt_UART.c:28655
void SYS_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_ExistsCRC(DMA_MODULE_ID index)
void PLIB_DMA_BusyActiveSet(DMA_MODULE_ID index)
void DRV_TMR0_StopInIdleEnable(void)
static void DRV_TMR1_Open(void)
Definition: inszt_UART.c:3743
bool PLIB_DMA_ChannelXCollisionStatus(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_COLLISION collisonType)
bool DRV_TMR_ClockSet(DRV_HANDLE handle, DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE preScale)
void SYS_DMA_ChannelSetupMatchAbortMode(SYS_DMA_CHANNEL_HANDLE handle, uint16_t pattern, DMA_PATTERN_LENGTH length, SYS_DMA_CHANNEL_IGNORE_MATCH ignore, uint8_t ignorePattern)
DRV_HANDLE DRV_SPI_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT ioIntent)
bool PLIB_USART_ExistsWakeOnStart(USART_MODULE_ID index)
bool PLIB_PORTS_ExistsAnPinsMode(PORTS_MODULE_ID index)
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26642
void SYS_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
uint16_t PLIB_DMA_ChannelXDestinationPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_TMR2_CounterValueSet(uint32_t value)
uint32_t DRV_TMR2_CounterValueGet(void)
void SYS_PORTS_PinPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_USART_ByteTransmitCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
SYS_MODULE_OBJ DRV_SPI_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_SPI_ReceiverHasOverflowed(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXChain(DMA_MODULE_ID index)
bool spiSlaveSSPin
Definition: inszt_adc.c:26547
uint32_t DRV_TMR2_CounterFrequencyGet(void)
uint8_t PLIB_USART_AddressGet(USART_MODULE_ID index)
void PLIB_USART_InitializeOperation(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE receiveInterruptMode, USART_TRANSMIT_INTR_MODE transmitInterruptMode, USART_OPERATION_MODE operationMode)
void DRV_TMR1_PeriodValueSet(uint32_t value)
SYS_ERROR_LEVEL gblErrLvl
void PLIB_DMA_ChannelXINTSourceDisable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
PORTS_DATA_MASK PLIB_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_DMA_ChannelXINTSourceFlagSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void PLIB_SPI_ErrorInterruptEnable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
DRV_USART_BUFFER_EVENT
Definition: inszt_adc.c:15096
bool PLIB_USART_ExistsTransmitterEmptyStatus(USART_MODULE_ID index)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
bool PLIB_DMA_ExistsChannelXPatternData(DMA_MODULE_ID index)
DRV_SPI_CLOCK_MODE
Definition: inszt_adc.c:26299
static int QQQfirstmcdc
Definition: inszt_UART.c:76
void DRV_TMR1_CounterValueSet(uint32_t value)
bool PLIB_USART_ExistsLineControlMode(USART_MODULE_ID index)
bool PLIB_USART_ReceiverFramingErrorHasOccurred(USART_MODULE_ID index)
bool PLIB_SPI_ExistsFrameSyncPulsePolarity(SPI_MODULE_ID index)
size_t DRV_USART_Write(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
void PLIB_USART_TransmitterByteSend(USART_MODULE_ID index, int8_t data)
void PLIB_DMA_CRCWriteByteOrderAlter(DMA_MODULE_ID index)
#define UART_71zqqzqz1
Definition: inszt_UART.c:79
bool PLIB_USART_ExistsRunInOverflow(USART_MODULE_ID index)
void PLIB_DMA_SuspendEnable(DMA_MODULE_ID index)
void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
uint32_t DRV_TMR_AlarmHasElapsed(DRV_HANDLE handle)
bool PLIB_DMA_ExistsChannelXCellProgressPointer(DMA_MODULE_ID index)
DRV_USART_INIT_FLAGS
Definition: inszt_adc.c:15364
void PLIB_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
SYS_DMA_CRC_WRITE_ORDER
Definition: inszt_adc.c:13358
bool PLIB_SPI_ExistsErrorInterruptControl(SPI_MODULE_ID index)
unsigned int DRV_USART0_TransmitBufferSizeGet(void)
void SYS_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_DMA_ExistsCRCBitOrder(DMA_MODULE_ID index)
void PLIB_USART_ReceiverAddressDetectDisable(USART_MODULE_ID index)
uint32_t DRV_TMR4_CounterFrequencyGet(void)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
bool PLIB_SPI_ExistsBuffer(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXNullWriteModeEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_SPI_FramedCommunicationEnable(SPI_MODULE_ID index)
PORTS_DATA_TYPE SYS_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION inputFunction, PORTS_REMAP_INPUT_PIN remapInputPin)
SPI_INPUT_SAMPLING_PHASE inputSamplePhase
Definition: inszt_adc.c:26578
bool PLIB_PORTS_ExistsChangeNoticePerPortStatus(PORTS_MODULE_ID index)
bool PLIB_USART_ExistsReceiver9Bits(USART_MODULE_ID index)
void PLIB_DMA_ChannelXStartIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQnum)
bool DRV_USART0_TransmitBufferIsFull(void)
uint32_t DRV_TMR3_CounterValueGet(void)
bool PLIB_USART_ReceiverOverrunHasOccurred(USART_MODULE_ID index)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26635
uint32_t DRV_TMR_CounterValueGet(DRV_HANDLE handle)
DRV_USART_ERROR
Definition: inszt_UART.c:15335
DRV_SPI_CLOCK_MODE
Definition: inszt_UART.c:26208
void DRV_PMP0_TimingSet(PMP_DATA_WAIT_STATES dataWait, PMP_STROBE_WAIT_STATES strobeWait, PMP_DATA_HOLD_STATES dataHold)
DRV_TMR_OPERATION_MODE DRV_TMR4_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
bool DRV_TMR3_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
bool PLIB_SPI_TransmitBufferIsFull(SPI_MODULE_ID index)
void PLIB_USART_Disable(USART_MODULE_ID index)
bool DRV_TMR4_Start(void)
static int qqqlast
Definition: inszt_UART.c:28686
void PLIB_PORTS_PinChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
uint32_t PLIB_DMA_ChannelXSourceStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_SPI_ExistsFIFOControl(SPI_MODULE_ID index)
uint32_t PLIB_SPI_BufferRead32bit(SPI_MODULE_ID index)
void SYS_PORTS_ChangeNotificationGlobalDisable(PORTS_MODULE_ID index)
void PLIB_DMA_Enable(DMA_MODULE_ID index)
void(* DRV_USART_BUFFER_EVENT_HANDLER)(DRV_USART_BUFFER_EVENT event, DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t context)
Definition: inszt_UART.c:15105
void DRV_SPI_Tasks(SYS_MODULE_OBJ object)
void DRV_TMR_CounterValueSet(DRV_HANDLE handle, uint32_t counterPeriod)
COMMAND_DATA CMD
Definition: commands.c:196
uint16_t PLIB_SPI_BufferRead16bit(SPI_MODULE_ID index)
void DRV_IC0_Initialize(void)
void DRV_PMP0_ModeConfig(void)
void SYS_DEBUG_Message(const char *message)
SYS_STATUS DRV_SPI_Status(SYS_MODULE_OBJ object)
bool DRV_TMR_GateModeSet(DRV_HANDLE handle)
void PLIB_DMA_ChannelXDestinationSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t destinationSize)
void DRV_ADC0_Open(void)
bool PLIB_DMA_ExistsChannelXINTSource(DMA_MODULE_ID index)
SPI_AUDIO_TRANSMIT_MODE audioTransmitMode
Definition: inszt_adc.c:26559
bool PLIB_DMA_ExistsCRCXOREnable(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsLatchRead(PORTS_MODULE_ID index)
SYS_STATUS SYS_DEBUG_Status(SYS_MODULE_OBJ object)
unsigned int DRV_USART_ReceiverBufferSizeGet(const DRV_HANDLE handle)
uintptr_t DRV_SPI_BUFFER_HANDLE
Definition: inszt_adc.c:26247
UART_STATES
Definition: inszt_app.c:30624
void DRV_TMR3_Initialize(void)
static void DRV_TMR4_Tasks(void)
Definition: inszt_UART.c:4134
uint32_t DRV_TMR2_PeriodValueGet(void)
bool PLIB_PORTS_ExistsPortsRead(PORTS_MODULE_ID index)
bool PLIB_DMA_ExistsStopInIdle(DMA_MODULE_ID index)
DRV_HANDLE DRV_TMR_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT intent)
bool PLIB_SPI_ExistsFIFOInterruptMode(SPI_MODULE_ID index)
SPI_AUDIO_PROTOCOL audioProtocolMode
Definition: inszt_adc.c:26561
bool PLIB_SPI_ExistsAudioProtocolMode(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXTransferCountSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t transferCount)
void SYS_PORTS_PinPullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint8_t DRV_PMP0_Read(void)
bool PLIB_SPI_ExistsFrameSyncPulseCounter(SPI_MODULE_ID index)
void PLIB_USART_IrDAEnable(USART_MODULE_ID index)
uint8_t numTrfsSmPolled
Definition: inszt_adc.c:26587
void DRV_ADC0_Close(void)
DRV_SPI_CLOCK_MODE clockMode
Definition: inszt_adc.c:26576
DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
void DRV_USART_ByteReceiveCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
void SYS_DMA_Resume(void)
void PLIB_DMA_ChannelXDisabledDisablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_PORTS_ExistsChangeNoticeEdgeControl(PORTS_MODULE_ID index)
size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
bool DepthStatus
Definition: commands.c:204
void APP_Tasks(void)
Definition: app.c:130
void PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void DRV_TMR4_Close(void)
Definition: inszt_UART.c:4094
void DRV_USART_BufferAddWrite(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *bufferHandle, void *buffer, const size_t size)
void PLIB_DMA_CRCDisable(DMA_MODULE_ID index)
void PLIB_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION outputFunction, PORTS_REMAP_OUTPUT_PIN remapOutputPin)
void DRV_TMR1_StopInIdleDisable(void)
SYS_DMA_CHANNEL_IGNORE_MATCH
Definition: inszt_UART.c:13225
SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_DMA_ChannelXChainToLower(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsReceiverIdleStatus(USART_MODULE_ID index)
void PLIB_USART_LoopbackDisable(USART_MODULE_ID index)
DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus(DRV_HANDLE handle)
DRV_TMR_CLIENT_STATUS DRV_TMR4_ClientStatus(void)
bool PLIB_SPI_ExistsOutputDataPhase(SPI_MODULE_ID index)
uintptr_t SYS_DMA_CHANNEL_HANDLE
Definition: inszt_adc.c:13249
void SYS_PORTS_ChangeNotificationPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
uint8_t DRV_USART_ReadByte(const DRV_HANDLE handle)
uint8_t DRV_USART0_ReadByte(void)
void PLIB_DMA_ChannelXCellSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t CellSize)
DRV_TMR_OPERATION_MODE
Definition: inszt_UART.c:1757
void DRV_TMR_Close(DRV_HANDLE handle)
void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void Init_Fifo(void)
Definition: fifo.c:100
static void qqoutput0(FILEPOINT char *s)
Definition: inszt_UART.c:28758
bool PLIB_SPI_FrameErrorStatusGet(SPI_MODULE_ID index)
void DRV_TMR0_StopInIdleDisable(void)
static DRV_TMR_OPERATION_MODE DRV_TMR1_OperationModeGet(void)
Definition: inszt_UART.c:3754
PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_USART_ReceiverAddressDetectEnable(USART_MODULE_ID index)
bool PLIB_DMA_ExistsBusy(DMA_MODULE_ID index)
Definition: app.h:59
uint8_t tx_count
Definition: commmodule.h:84
DRV_USART_OPERATION_MODE
Definition: inszt_UART.c:14968
void DRV_TMR4_StopInIdleEnable(void)
int16_t PLIB_USART_Receiver9BitsReceive(USART_MODULE_ID index)
uint32_t DRV_ADC_SamplesRead(uint8_t bufIndex)
void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
void DRV_IC_Stop(DRV_HANDLE handle)
void DRV_TMR4_Initialize(void)
bool PLIB_USART_ExistsReceiver(USART_MODULE_ID index)
void DRV_IC0_Start(void)
bool PLIB_DMA_ExistsLastBusAccess(DMA_MODULE_ID index)
DRV_USART_BUFFER_RESULT
Definition: inszt_adc.c:15118
void DRV_USART_TasksTransmit(SYS_MODULE_OBJ object)
bool PLIB_SPI_ExistsFramedCommunication(SPI_MODULE_ID index)
void DRV_USART0_TasksReceive(void)
bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
bool PLIB_SPI_ExistsInputSamplePhase(SPI_MODULE_ID index)
void PLIB_USART_TransmitterDisable(USART_MODULE_ID index)
TMR_PRESCALE DRV_TMR_PrescalerGet(DRV_HANDLE handle)
void PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
SYS_DMA_SIDL
Definition: inszt_UART.c:13184
uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
void PLIB_USART_OperationModeSelect(USART_MODULE_ID index, USART_OPERATION_MODE operationmode)
INT_SOURCE rxInterruptSource
Definition: inszt_adc.c:26582
uint16_t PLIB_DMA_ChannelXTransferCountGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool DRV_TMR2_Start(void)
PORTS_PIN_INTERRUPT_TYPE
Definition: inszt_adc.c:21903
bool PLIB_DMA_ExistsEnableControl(DMA_MODULE_ID index)
static void DRV_TMR0_Open(void)
Definition: inszt_UART.c:3633
bool PLIB_DMA_ExistsCRCByteOrder(DMA_MODULE_ID index)
bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
COMM_DATA COMM
Definition: commmodule.c:58
SYS_DMA_DATA_WIDTH
Definition: inszt_UART.c:13431
bool PLIB_DMA_ExistsCRCPolynomialLength(DMA_MODULE_ID index)
void PLIB_USART_IrDADisable(USART_MODULE_ID index)
void PLIB_PORTS_ChannelModeSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK modeMask, PORTS_PIN_MODE mode)
TMR_PRESCALE DRV_TMR0_PrescalerGet(void)
static void DRV_TMR4_DeInitialize(void)
Definition: inszt_UART.c:4053
DRV_TMR_CLIENT_STATUS
Definition: inszt_UART.c:1710
uint8_t PLIB_DMA_CRCPolynomialLengthGet(DMA_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
uintptr_t DRV_SPI_BUFFER_HANDLE
Definition: inszt_UART.c:26156
DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet(DRV_HANDLE handle, DRV_TMR_DIVIDER_RANGE *pDivRange)
void PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
uintptr_t DRV_USART_BUFFER_HANDLE
Definition: inszt_UART.c:14944
bool PLIB_USART_ExistsReceiverAddress(USART_MODULE_ID index)
INT_SOURCE errInterruptSource
Definition: inszt_adc.c:26584
DRV_TMR_CLK_SOURCES
Definition: inszt_adc.c:1694
bool PLIB_SPI_ReceiverFIFOIsEmpty(SPI_MODULE_ID index)
bool DRV_TMR_AlarmDisable(DRV_HANDLE handle)
ldra_void_function qqqaccumreset[QQQnumfil]
Definition: inszt_main.c:154
void APP_Initialize(void)
Definition: app.c:93
void PLIB_SPI_CommunicationWidthSelect(SPI_MODULE_ID index, SPI_COMMUNICATION_WIDTH width)
void DRV_TMR4_CounterClear(void)
void DRV_TMR2_Initialize(void)
void SYS_DEBUG_Deinitialize(SYS_MODULE_OBJ object)
bool PLIB_USART_ExistsReceiverAddressAutoDetect(USART_MODULE_ID index)
void DRV_TMR4_StopInIdleDisable(void)
void DRV_ADC1_Close(void)
static void qqqupload(qqnull_params)
Definition: inszt_UART.c:28929
uint32_t DRV_TMR1_CounterValueGet(void)
void PLIB_USART_Transmitter9BitsSend(USART_MODULE_ID index, int8_t data, bool Bit9th)
void DRV_TMR0_Stop(void)
bool PLIB_DMA_ChannelXINTSourceIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
size_t DRV_USART_BufferCompletedBytesGet(DRV_USART_BUFFER_HANDLE bufferHandle)
bool PLIB_PORTS_ExistsChangeNoticePerPortTurnOn(PORTS_MODULE_ID index)
void PLIB_PORTS_ChangeNoticeDisable(PORTS_MODULE_ID index)
DRV_SPI_MODE spiMode
Definition: inszt_adc.c:26541
void SYS_PORTS_PinPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_ChannelXDisabledEnablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_TMR3_StopInIdleDisable(void)
void PLIB_DMA_ChannelXAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_ADDRESSING_MODE channelAddressMode)
DRV_USART_BAUD_SET_RESULT DRV_USART0_BaudSet(uint32_t baud)
bool PLIB_SPI_ExistsTransmitUnderRunStatus(SPI_MODULE_ID index)
SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
bool DRV_TMR_AlarmRegister(DRV_HANDLE handle, uint32_t divider, bool isPeriodic, uintptr_t context, DRV_TMR_CALLBACK callBack)
void PLIB_DMA_ChannelXOperatingTransferModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRANSFER_MODE channeltransferMode)
DRV_USART_ERROR DRV_USART_ErrorGet(const DRV_HANDLE client)
void DRV_PMP0_Initialize(void)
bool PLIB_DMA_ExistsChannelXAuto(DMA_MODULE_ID index)
#define DRV_IC_Open(drvIndex, intent)
Definition: inszt_UART.c:1326
uint32_t DRV_TMR4_PeriodValueGet(void)
bool PLIB_DMA_ChannelXINTSourceFlagGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void PLIB_SPI_BufferWrite32bit(SPI_MODULE_ID index, uint32_t data)
void DRV_USART0_TasksError(void)
static void qqoutput2(FILEPOINT char *s, int i, int j)
Definition: inszt_UART.c:28766
bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_CHANGE_NOTICE_EDGE cnEdgeType)
uint16_t PLIB_DMA_ChannelXSourceSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet(DMA_MODULE_ID index)
DRV_SPI_TASK_MODE taskMode
Definition: inszt_adc.c:26539
uint8_t Fifo_Length(TFifo *ptrFifo)
Definition: fifo.c:202
SYS_ERROR_LEVEL
Definition: inszt_UART.c:17457
void PLIB_SPI_AudioCommunicationWidthSelect(SPI_MODULE_ID index, SPI_AUDIO_COMMUNICATION_WIDTH mode)
void PLIB_SPI_PinEnable(SPI_MODULE_ID index, SPI_PIN pin)
bool PLIB_SPI_ExistsMasterControl(SPI_MODULE_ID index)
USART_ERROR PLIB_USART_ErrorsGet(USART_MODULE_ID index)
void DRV_USART_BufferAddRead(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *const bufferHandle, void *buffer, const size_t size)
bool PLIB_USART_ExistsTransmitterBreak(USART_MODULE_ID index)
bool PLIB_SPI_ExistsTransmitBufferFullStatus(SPI_MODULE_ID index)
void PLIB_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_USART_BaudRateHighSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
void PLIB_DMA_ChannelXPatternIgnoreSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint8_t pattern)
COMM_STATES state
Definition: commmodule.h:81
bool PLIB_USART_TransmitterBreakSendIsComplete(USART_MODULE_ID index)
int32_t DRV_SPI_ClientConfigure(DRV_HANDLE handle, const DRV_SPI_CLIENT_DATA *cfgData)
void PLIB_USART_InitializeModeGeneral(USART_MODULE_ID index, bool autobaud, bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle)
uint32_t PLIB_DMA_RecentAddressAccessed(DMA_MODULE_ID index)
void PLIB_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
bool PLIB_DMA_ExistsChannelXBusy(DMA_MODULE_ID index)
bool Valid_Command(uchar8_t msg)
Definition: commands.c:1111
DRV_USART_BAUD_SET_RESULT DRV_USART_BaudSet(const DRV_HANDLE client, uint32_t baud)
void PLIB_SPI_FIFODisable(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsPinControl(SPI_MODULE_ID index)
void PLIB_DMA_StopInIdleDisable(DMA_MODULE_ID index)
static void DRV_TMR0_Tasks(void)
Definition: inszt_UART.c:3694
void PLIB_USART_StopInIdleEnable(USART_MODULE_ID index)
void PLIB_PORTS_ChangeNoticeEnable(PORTS_MODULE_ID index)
bool PLIB_PORTS_PinGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static void Execute_Protocol_B(void)
SYS_PORTS_PULLUP_PULLDOWN_STATUS
Definition: inszt_UART.c:21773
DRV_HANDLE handleUSART0
Definition: commmodule.h:83
bool PLIB_DMA_ChannelXTriggerIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
void PLIB_DMA_ChannelXTransferDirectionSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection)
bool PLIB_SPI_ExistsFrameSyncPulseWidth(SPI_MODULE_ID index)
void PLIB_USART_ReceiverEnable(USART_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXCellSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_SPI_AudioProtocolDisable(SPI_MODULE_ID index)
void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level)
DMA_CRC_TYPE PLIB_DMA_CRCTypeGet(DMA_MODULE_ID index)
static char qqqqone[]
Definition: inszt_UART.c:28682
SYS_DMA_CHANNEL_CRC_MODE
Definition: inszt_UART.c:13244
bool GetDepthStatus(void)
ldra_void_function qqqaccumupload[QQQnumfil]
Definition: inszt_main.c:153
void SYS_DMA_ChannelTransferAdd(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
SPI_FRAME_SYNC_PULSE frameSyncPulse
Definition: inszt_adc.c:26549
void PLIB_USART_AddressMaskSet(USART_MODULE_ID index, uint8_t mask)
bool PLIB_USART_ReceiverParityErrorHasOccurred(USART_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
bool SYS_PORTS_PinRead(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_DEBUG_Print(const char *format,...)
void(* SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER)(SYS_DMA_TRANSFER_EVENT event, SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
Definition: inszt_UART.c:13538
bool PLIB_USART_ExistsReceiverEnable(USART_MODULE_ID index)
DRV_SPI_BUFFER_TYPE
Definition: inszt_UART.c:26253
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
void DRV_TMR0_CounterValueSet(uint32_t value)
bool PLIB_DMA_ExistsChannelXDestinationPointer(DMA_MODULE_ID index)
void DRV_USART_WriteByte(const DRV_HANDLE handle, const uint8_t byte)
void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
bool PLIB_USART_ExistsLoopback(USART_MODULE_ID index)
static struct bitmapstruct_t bitmapstruct
SYS_DMA_TRANSFER_EVENT
Definition: inszt_adc.c:13469
void DRV_USART_BufferEventHandlerSet(const DRV_HANDLE handle, const DRV_USART_BUFFER_EVENT_HANDLER eventHandler, const uintptr_t context)
bool PLIB_DMA_SuspendIsEnabled(DMA_MODULE_ID index)
void PLIB_USART_TransmitterIdleIsLowEnable(USART_MODULE_ID index)
void DRV_SPI_Deinitialize(SYS_MODULE_OBJ object)
int QQQindicator
Definition: inszt_main.c:104
void SYS_PORTS_ChangeNotificationInIdleModeEnable(PORTS_MODULE_ID index)
void PLIB_DMA_ChannelXNullWriteModeDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_ADC_Stop(void)
void PLIB_DMA_CRCPolynomialLengthSet(DMA_MODULE_ID index, uint8_t polyLength)
static void ValidateComm(void)
void PLIB_DMA_ChannelXSourceSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t sourceSize)
void SYS_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_ADDRESS_OFFSET_TYPE offset)
DRV_SPI_TASK_MODE
Definition: inszt_UART.c:26353